Business Development

Process driven.

Results driven.

Staging Bedrock and Sage via Trellis

Last updated By
To deploy to IP address on staging:

    1. If your ssh key isn’t tied into your Github, add the server’s SSH key to your Github keys
    2. Configure your WordPress sites in your group_vars/ folder.
      1. In group-vars/users, add your github’s public keys
      2. In group-vars/staging/wordpress_sites.yml, update example.comwhich you’ll need for step 9.
      3. In group-vars/staging/vault.yml, update example.com which you’ll need for step 9.
      4. Swap out site host for your desired IP/domain under site_hosts: canonical:
      5. Update the github url to your project’s url
      6. Note: For additional configuration info see Root’s remote servers documentation. Also see the Passwords docs.
    3. Add your server IP/hostnames to hosts/staging
    4. Verify that your IP/domain has been added to /etc/hosts
    5. Follow these instructions and uncomment out the deploy hook.
    6. Generate Salts by following these instructions and replace them on lines 15-22. Use the Salts for Trellis.
    7. Commit the changes to Github
    8. In Trellis, provision the server by running: ansible-playbook server.yml -e env=staging
    9. Run ./bin/deploy.sh staging example.com(example.com is defined in step 2.3)

Deploying to DNS (in staging or production):

    1. Update A Records (in DigitalOcean), to your new IP (assuming you’re using the default IPv4, instead of IPv6)
      1. @ [host name]
      2. www [host name]
    2. Replace example.com with your domain in group_vars/[environment]
      • Also add a www. redirect
      • Make sure the repo url is set correctly
      • * Optional: Set ssl: enabled: true if you want HTTPS enabled via Letsencrypt
    3. Replace your_server_hostname with domain in hosts/[environment]
    4. Commit to your Git Repo
    5. Add hosts in /etc/hosts:
      1. [IP-address] domain.com,
      2. [IP-address] www.domain.com
    6. In Trellis, provision the server by running: ansible-playbook server.yml -e env=[environment]
      1. If that returns an SSH error, then check out your known_hosts file, and delete any duplicates/un-used IPs
      2. Re-run #4
    7. Run ./bin/deploy.sh staging example.com (sitename is defined in group_vars/[environment])
    8. *After you have provisioned and deployed, double check to make sure salts were generated, run: ansible-vault view group_vars/[env]/vault.yml

Leave a Reply

Your email address will not be published. Required fields are marked *