Skip to content

Instantly share code, notes, and snippets.

@ahsan518
Forked from jimbaker/craton-dev-start.sh
Created February 1, 2017 18:09
Show Gist options
  • Save ahsan518/7df7d1a309eaa944135b6c24ae79eba5 to your computer and use it in GitHub Desktop.
Save ahsan518/7df7d1a309eaa944135b6c24ae79eba5 to your computer and use it in GitHub Desktop.
Craton dev start script
docker rm -f craton-api || true
docker build --pull -t craton-api:latest .
docker run -t --name craton-api -p 127.0.0.1:8080:8080 -d craton-api:latest
# wait until API server is available by probing it
until curl http://127.0.0.1:8080/v1/regions -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
do
echo "Waiting for API server"; sleep 1
done
sleep 1
# run setup
python tools/generate_fake_data.py --url http://127.0.0.1:8080/v1 --user demo --project b9f10eca66ac4c279c139d01e65f96b4 --key demo
# verify something is now returned
curl http://127.0.0.1:8080/v1/regions -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment