This gist is an implementation of http://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.html on top of Docker Machine and Docker Swarm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"server": true, | |
"rejoin_after_leave": true, | |
"enable_syslog": false, | |
"syslog_facility": "local5", | |
"data_dir": "/var/consul/data", | |
"ui_dir": "/var/consul/ui", | |
"datacenter": "dc1", | |
"statsd_addr": "<some IP>:8125", | |
"recursor": "<some IP>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
$Filter=".*", | |
#TODO: handle https & no basic auth as well.. | |
$RegistryEndpoint = "registry.mysite.com", | |
$UserName = "user", | |
$Password = "password" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case status | |
when 0 then 'New' | |
when 1 then 'Assigned' | |
when 2 then 'In Progress' | |
when 3 then 'Pending' | |
when 4 then 'Resolved' | |
when 5 then 'Closed' | |
when 6 then 'Cancelled' | |
else to_char(status) | |
end status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub SendRemedyIncidentEmail() | |
Const adUseClient = 3 | |
Const adOpenStatic = 3 | |
Const adLockPessimistic = 2 | |
' Remedy User Name | |
Const AR_SYSTEM_ODBC_DRIVER_UID = "" | |
' Password for Remedy User Name (AR_SYSTEM_ODBC_DRIVER_UID) | |
Const AR_SYSTEM_ODBC_DRIVER_PWD = "" | |
' Port used by the Remedy server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<enricher doc:name="Message Enricher" source="#[payload]" target="#[flowVars['itsm-event-data']]"> | |
<remedy:get-single username="${remedy.read.username}" password="${remedy.read.password}" config-ref="RemedyConnection" id="#[message.outboundProperties['remedy_event_id']]" type="${remedy.outbound.table}" idBased="#[true]" doc:name="get-event-details"/> | |
</enricher> | |
<set-payload value="#[message.outboundProperties['remedy_form_id']]" doc:name="Set Payload"/> | |
<choice doc:name="Choice"> | |
<when expression="#[message.outboundProperties['remedy_form'] == '${helpdesk.form}']"> | |
<remedy:query username="${remedy.read.username}" password="${remedy.read.password}" config-ref="RemedyConnection" query="('Incident Number' = "#[payload]")" type="${helpdesk.form}" idBased="#[true]" doc:name="query-helpdesk-form"/> | |
<set-payload value="#[payload.get(0)]" doc:name="Get first entry"/> | |
</when> | |
<otherwise> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# build | |
# | |
# # docker build -t consul:latest . | |
# | |
# bootstrap server | |
# | |
# # docker run -d consul -server -bootstrap | |
# # docker inspect (container_id) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
registry: | |
restart: always | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
environment: | |
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry | |
volumes: | |
- ./data:/var/lib/registry |
Unionize lets you connect together docker containers in arbitrarily complex scenarios.
Note: I recommend to use https://github.com/jpetazzo/pipework instead.
- pipework is a better name than unionize
- it's hosted on a "real" github repo instead of a small gist :-)
Now if you want Unionize, it's still here. Just check those examples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" != "" ] && [ "$1" = "-h" ]; then | |
echo "Shipyard Deploy uses the following environment variables:" | |
echo " ACTION: this is the action to use (deploy, upgrade, remove)" | |
echo " IMAGE: this overrides the default Shipyard image" | |
echo " PREFIX: prefix for container names" | |
echo " SHIPYARD_ARGS: these are passed to the Shipyard controller container as controller args" | |
echo " TLS_CERT_PATH: path to certs to enable TLS for Shipyard" | |
exit 1 |