mirror of https://github.com/perkeep/perkeep.git
website: name the demo blobserver container, kill on start-up
This commit is contained in:
parent
321272d65c
commit
afd28ae279
|
@ -66,7 +66,7 @@ coreos:
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=/bin/sh -c 'mkdir -p /opt/bin && /usr/bin/curl -f -o /opt/bin/$NAME $URL?$(date +%s) && chmod +x /opt/bin/$NAME'
|
||||
ExecStartPre=/bin/sh -c 'mkdir -p /opt/bin && /usr/bin/curl --silent -f -o /opt/bin/$NAME $URL?$(date +%s) && chmod +x /opt/bin/$NAME'
|
||||
ExecStart=/opt/bin/$NAME
|
||||
RestartSec=10
|
||||
Restart=always
|
||||
|
|
|
@ -470,9 +470,16 @@ func runDemoBlobserverLoop() {
|
|||
if _, err := exec.LookPath("docker"); err != nil {
|
||||
return
|
||||
}
|
||||
const name = "demoblob3179"
|
||||
if err := exec.Command("docker", "kill", name).Run(); err == nil {
|
||||
// It was actually running.
|
||||
exec.Command("docker", "rm", name).Run()
|
||||
log.Printf("Killed, removed old %q container.", name)
|
||||
}
|
||||
for {
|
||||
cmd := exec.Command("docker", "run",
|
||||
"--rm",
|
||||
"--name="+name,
|
||||
"-e", "CAMLI_ROOT="+prodSrcDir+"/website/blobserver-example/root",
|
||||
"-e", "CAMLI_PASSWORD="+randHex(20),
|
||||
"-v", camSrcDir()+":"+prodSrcDir,
|
||||
|
|
Loading…
Reference in New Issue