Deploy Waxx

Waxx includes a very simple deploy system. You are free to use any other deployment mechananism.

Steps to deploy to the stage environment:

  1. Setup the config file for the environment (opt/stage/config.yaml). See Config Waxx.
  2. Add a deploy script in the environment folder (opt/stage/deploy)
  3. Add the stage server(s) and options to opt/deploy.yaml
  4. Run: waxx deploy stage

Deploy Script

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:


  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.

Before Deploy Script

Tag the push and push. You could also update caches, add unique keys, send info to slack or whatever.


#!/usr/bin/env ruby

deploy_to = ARGV[0]  # ARGV[0] is the value of: waxx deploy {deploy_to}
timestamp ='%Y-%m-%d.%H.%M')

`git tag #{deploy_to}-#{timestamp}`
`git push`

Deploy Config

Tell Waxx what servers to connect to and what command to run on each server.


  before: /home/waxx/bin/before-deploy
    user: stage-user
    cert: /home/waxx/certs/stage-2017.pem
    command: /home/waxx/stage/opt/active/deploy
    user: stage-user
    cert: /home/waxx/certs/stage-2017.pem
    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 and 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.

Initial Deploy

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@
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.