set_volumes
- docker run -cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $image /bin/bash -c 'cd /pups && git pull'
- docker commit `cat $cidbootstrap` $local_discourse/up_to_date_pups
- docker rm `cat $cidbootstrap` && rm $cidbootstrap
+ rm -f $cidbootstrap
+
+ (exec echo "$input" | docker run -cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $image \
+ /bin/bash -c 'cd /pups && git pull && /pups/bin/pups --stdin') \
+ || (docker rm `cat $cidbootstrap` && rm $cidbootstrap)
- (exec echo "$input" | docker run -cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $local_discourse/up_to_date_pups /pups/bin/pups --stdin) \
- || exit 1 && docker rm `cat $cidbootstrap` && rm $cidbootstrap && exit 1
+ [ ! -e $cidbootstrap ] && echo "FAILED TO BOOTSTRAP" && exit 1
+
+ sleep 5
- sleep 10
docker commit `cat $cidbootstrap` $local_discourse/$config || echo 'FAILED TO COMMIT'
docker rm `cat $cidbootstrap` && rm $cidbootstrap
+
+ echo "Successfully bootstrappd, to starup use ./launcher start $config"
exit 0
;;
from: "# postgres"
to: sv start postgres || exit 1
-
run:
-
- file:
path: /etc/service/postgres/run
chmod: "+x"
- exec:
cmd:
- chown -R root /var/lib/postgresql/9.2/main
- - "[ ! -e /shared/postgres_data ] && cp -r /var/lib/postgresql/9.2/main /shared/postgres_data || exit 0"
+ - "[ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -u postgres /usr/lib/postgresql/9.2/bin/initdb -D /shared/postgres_data || exit 0"
- chown -R postgres:postgres /shared/postgres_data
- replace: