Waxx includes a very simple deploy system. You are free to use any other deployment mechananism.
Steps to deploy to the stage environment:
opt/stage/config.yaml
). See Config Waxx.opt/stage/deploy
)opt/deploy.yaml
waxx deploy stage
The deploy script in opt/stage/deploy is run on each staging server defined in opt/deploy.yaml
.
A very simple deploy script could be:
opt/stage/deploy
cd /usr/home/waxxx/stage && git pull && waxx migrate && waxx restart
This is very simple but it can be any command like make or rake, a Bash script, a Ruby script, etc.
Tag the push and push. You could also update caches, add unique keys, send info to slack or whatever.
bin/before-deploy
#!/usr/bin/env ruby
deploy_to = ARGV[0] # ARGV[0] is the value of: waxx deploy {deploy_to}
timestamp = Time.new.strftime('%Y-%m-%d.%H.%M')
`git tag #{deploy_to}-#{timestamp}`
`git push`
Tell Waxx what servers to connect to and what command to run on each server.
opt/deploy.yaml
stage:
before: /home/waxx/bin/before-deploy
stage1:
user: stage-user
cert: /home/waxx/certs/stage-2017.pem
host: 34.35.36.10
command: /home/waxx/stage/opt/active/deploy
stage2:
user: stage-user
cert: /home/waxx/certs/stage-2017.pem
host: 34.35.36.11
command: /home/waxx/stage/opt/active/deploy
With those three files in place, deploy to the stage servers.
waxx deploy stage
This command will execute bin/before-deploy stage
then ssh to 34.35.36.10 and 34.35.36.11 as the user stage-user using the key /home/waxx/certs/stage-2017.pem and execute /home/waxx/stage/opt/active/deploy
on each stage server in series.
Note that this deploy process only works after you have Waxx setup on the remote server and the waxx/root folder is setup. So you will need to take the following steps before you use this deploy mechanism.
ssh stage-user@34.35.36.10
cd /home/waxx
git clone <pathe-to-your-git-repo> stage
Now you can deploy from your dev box or anwhere else that has the config setup.