Last active
September 23, 2015 01:19
-
-
Save kballenegger/1f0d0bace3f0a3376545 to your computer and use it in GitHub Desktop.
Systemd config mess.
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
[Unit] | |
Description=API Internal | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
ExecStartPre=/bin/bash /repos/services/api-internal/init.sh pre-start | |
ExecStart=/bin/bash /repos/services/api-internal/init.sh start |
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 | |
case "$1" in | |
pre-start) | |
cd /repos/api-internal | |
git fetch && git checkout origin/master | |
docker pull quay.io/kballenegger/rack-app | |
;; | |
start) | |
docker run | |
-p 80:9977 | |
-v /repos/api-internal:/app | |
quay.io/kballenegger/rack-app | |
bash -l -c <<'CMD' | |
bundle install --deployment --without="test development" && | |
bundle exec thin -R config.ru -p 9977 start | |
CMD | |
;; | |
*) | |
echo "Usage: $0 {pre-start|start}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment