This file contains 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
docker run \ | |
--name={{.Name}} \ | |
{{range $e := .Config.Env}}--env="{{$e}}" \ | |
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \ | |
{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from="{{.}}" \ | |
{{end}}{{range $v := .HostConfig.Binds}}--volume="{{.}}" \ | |
{{end}}{{range $l, $v := .Config.Labels}}--label "{{$l}}"="{{$v}}" \ | |
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{.}} \ | |
{{end}}{{range $v := .HostConfig.CapDrop}}--cap-drop {{.}} \ | |
{{end}}{{range $d := .HostConfig.Devices}}--device={{(index $d).PathOnHost}}:{{(index $d).PathInContainer}}:{{(index $d).CgroupPermissions}} \ |
This file contains 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
// Groovy script to disable job in Hudson | |
import hudson.model.*; | |
def JOB_PATTERN = ~/^GO.*.deploy*.staging2$/; //find all jobs starting with "MY_JOB". | |
(Hudson.instance.items.findAll { job -> job.name =~ JOB_PATTERN }).each { job_to_update -> | |
if (job_to_update.name =~ "^\$") { | |
return; | |
} | |
else { |
This file contains 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
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strconv" | |
) |
This file contains 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 | |
# Updates all EC2 instances from git | |
# Author: anton@sothree.com | |
CODE_LOCATION=/var/www/your_project | |
SERVER_PREFIX=your_project | |
# exit if something fails | |
set -e |