Giter Club home page Giter Club logo

terminus-update-scripts's Introduction

Terminus Update Scripts

Terminus v1.x Compatible

A set of bash scripts for "mass updating" sites on Pantheon using Terminus. These scripts are tooled for WordPress sites but can easily be repurposed for Drupal sites. While there is a Terminus Mass Update plugin, these scripts rely solely on base terminus commands; no additional plugins necessary. However, these scripts require setting ENVIRONMENT_VARIABLES to store "secrets". I chose to put them in a local file that is not included in this repository. You may view a reference to it in the scripts. Directions for setting the environment variables are provided below.

Reqiurements

The scripts

There are two sets of scripts in this repo, a set for updating multiple sites and a set for updating a single site. Each set of scripts consists of three scripts, each script addressing either the dev, test or live Pantheon Environments.

The following is a list of the scripts included and a brief description of each does. These scripts should generally be run in the order listed below:

  1. Update dev update-site-dev.sh or update-sites-dev.sh
    Update core <site>.<dev>:
    -- check whether WordPress core updates are available.
    -- set connection of all sites to git mode
    -- apply upstream updates
    -- reset connection of all sites to sftp mode
    -- clear all caches
    Apply WordPress theme and plugin updates:
    -- update any plugins that need updating
    -- update any themes that need updating
    -- commit updates to the environment with a message
    -- clear caches in the <site>.<dev> environment
    -- open all <site>.<dev> environments in browser tabs for review

  2. Deploy from <site>.<dev> to <site>.<test>: deploy-site-to-test.sh or deploy-sites-to-test.sh
    -- deploy sites to <site>.<test> with commit message
    -- clear all caches
    -- open all <site>.<test> environments in browser tabs for review

  3. deploy-to-live.sh
    Does exactly the same tha Script 2 does, except deploys from <site>.<test> to <site>.<live>.

Set environment variables

I use a local script named secrets.sh placed in the same directory as the scripts. This is where the environment variables are set. To do similar, create a new file in each of the script directories:

touch /my-scripts-location/multiple-sites/secrets.sh

touch /my-scripts-location/single-site/secrets.sh

Multiple sites

The PANTHEON_ORG environment variable used for updating multiple sites. Into your multiple-sites secrets.sh script, paste the following, using your own ORG UUID:

#!/bin/bash
# Stash ORG UUID
export PANTHEON_ORG="5234...9de8"

Single site

The SITE_NAME environment variable is used for updating single sites. Into your single-site secrets.sh script, paste the following, using any portion of your single site's name:

#!/bin/bash
# Stash site name
export SITE_NAME="my-site-name"

Make scripts executable

sudo chmod +x /my-scripts-location/multiple-sites/secrets.sh

sudo chmod +x /my-scripts-location/single-site/secrets.sh

Run scripts

Once the environment variables are set, the scripts should be run in the order described above.

# note: let each script complete before running the next
user@machine:~$ ./update-sites-to-dev.sh

user@machine:~$ ./deploy-sites-to-test.sh

user@machine:~$ ./deploy-sites-to-live.sh

terminus-update-scripts's People

Contributors

herm71 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.