Skip to content

Instantly share code, notes, and snippets.

@mhewedy
Last active January 15, 2020 07:26
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 mhewedy/a2bd21cdf0f7c5619d91806fb8eabf2c to your computer and use it in GitHub Desktop.
Save mhewedy/a2bd21cdf0f7c5619d91806fb8eabf2c to your computer and use it in GitHub Desktop.
cheap feature branch deploy
#script to make ad-hoc cheap deploy for a git feature-branch
input: ubuntu machine IP & root username&password (EC2 or Digitalocean VM)
input will be saved in the github/bitbucet variables and referenced by varname
1. scp docker-compose file for dependent services (e.g. db) to the remote server
2. scp docker file + the artifact (e.g. war file) to the remote server
3. run the following on remote server (ssh)
a. install docker & docker-compose
b. run docker-compose file, make sure sevices start on uniq ports
c. build docker image
e. run docker image make sure the app start on uniq port (>= 8080)
4. print the IP/PORT for the running service
------ OUTPUT ------
running app instance with empty database
TODO: the cleanup script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment