Created
October 10, 2013 16:37
-
-
Save egaillot/6921454 to your computer and use it in GitHub Desktop.
An anticipatory Christmas present, offered as a solidarity token to all the code-storists of the world who are spending their life in elevators.
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 -ex | |
#---------- You will need to adjust these values to suit your needs --------- | |
#---------- You shouldn't need to touch the rest of the script --------- | |
#---------- (That is, if you have bash in your system) --------- | |
export REGISTRAR_BASE_URL=http://elevator.retour1024.eu.cloudbees.net | |
export SERVER_URL=http://your.server.address/path/to/app | |
export PSEUDO=DeLift | |
export EMAIL=your.email@address.com | |
export PASSWORD_FILE=../code-elevator.password | |
LAUNCH_SERVER_COMMAND=your_launch_script.sh | |
#---------------------------------------------------------------------------- | |
SERVER_PID=../elevator-engine.pid | |
unregister-server.sh | |
trap unregister-server.sh EXIT | |
kill $(cat ${SERVER_PID}) || true | |
LAUNCH_SERVER_COMMAND | |
echo $! > ${SERVER_PID} | |
register-server.sh | |
wait |
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 -ex | |
curl -X POST "${REGISTRAR_BASE_URL}/resources/player/register?email=${EMAIL}&pseudo=${PSEUDO}&serverURL=${SERVER_URL}" > ${PASSWORD_FILE} |
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 -ex | |
curl -u "${EMAIL}:$(cat ${PASSWORD_FILE})" -X POST "${REGISTRAR_BASE_URL}/resources/player/unregister?email=${EMAIL}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment