- Change
hosts/staging
to match you staging server ip address - Change
api_domain,web_domain,landing_domain
domains in thevars/main.yml
- Change name of the docker images in the
deploy-app.yml
to match yours. e.x.:paralect/ship-api
tocompany/yourProduct-api
- Use
./bin/setup-server.sh
for one time server configuration. That installs Docker, MongoDb and Nginx. - Use
./bin/setup-nginx.sh -i ./hosts/staging --extra-vars "env=staging"
for the first time and after nginx config changes to copy nginx template to the server.
- Copy/paste
vars/credentials-template.yml
ascredentials.yml
(it's in .gitignore to keep you DockerHub credentials out of the repo) - Add your DockerHub credentials into
credentials.yml
- Manually run
./bin/deploy-staging.sh --extra-vars docker_tag=latest
. Change tag as needed.
CI server works in the following way:
- Run tests when pull request created or modified.
- Deploy changes to the staging environment once code pushed to the master branch
- (TODO). Deploy changes to the production environment once code pushed to the production branch.
- Add DockerHub credentials (
docker_username, docker_password, docker_email
) from the Drone UI. - Copy/paste
Example CLI Usage
code from drone UI and paste into the terminal - Add your ssh_key for the deployment:
drone secret add \ -repository paralect/ship \ -name SSH_KEY \ -value @/Users/andrew/.ssh/id_rsa