Skip to content

Instantly share code, notes, and snippets.

@kmccarth
Created November 16, 2018 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmccarth/2bc67e8db22c3caf00d61bb2d51172ef to your computer and use it in GitHub Desktop.
Save kmccarth/2bc67e8db22c3caf00d61bb2d51172ef to your computer and use it in GitHub Desktop.
#!/bin/bash
# chmod a+x refreshDevApi.sh;
# ./refreshDevApi.sh;
# 1) get the latest prod data to the dev db
# 2) re-deploy dev api
# - kdm
#
# config
uname="YYYYY"
key="XXXXX"
# take prod snapshot. throttled to max 5 per Hour. data is sanitized
curl -X POST "https://$uname:$key@ci.hqoapp.com/job/MySQL%20Dump%20(Production)/build";
# ... it takes about 40 seconds
sleep 40s
# re-seed dev db using snapshot
curl -X POST "https://$uname:$key@ci.hqoapp.com/job/MySQL%20Refresh%20Data%20(Development)/build";
# deploy api code again (for migrations)
curl -X POST "https://$uname:$key@ci.hqoapp.com/job/API%20(Development)/build";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment