Giter VIP home page Giter VIP logo

deployment_helpers's Introduction

These deployment helper scripts where originally created to help with the deployment process of Arethusa on Perseids servers.

The idea is to easily reference a production and a staging build with the ability to roll back and forth between them and having access to several versioned builds of the software.

Let's say we have a folder hierarchy which we use to store versioned builds of our application.

app/
  v1/
  v2/
  v3/

and another folder called server, which contains files that are exposed to the internet.

We first export an environmental variable, so that the helper scripts know where to work.

export DEPLOYMENT_HELPER_TARGET="server"

We launch the setup script to build up the initial set of links we need in future steps. The first argument of the script is the name of the application, we go for app in this example.

depl-help-setup app

This will create a couple of files in the server folder

server/
  app -> app-prod-1
  app-staging -> app-dev-1
  app-prod-1
  app-prod-2
  app-prod-3
  app-dev-1
  app-dev-2
  app-dev-3

app links to app-prod-1, app-staging links to app-dev-1. The other files will be used to link to the actual directories that contain our builds.

depl-help-deploy app app/v1 dev

will create a link from app-dev-1 to the app/v1 folder. Remember that the tip of the dev link hierarchy is also referenced by app-staging.

Let's repeat the process and add a reference to app/v2, also in the dev environment.

depl-help-deploy app app/v2 dev

app-dev-1 now links to app/v2. The former reference of app-dev-1 was pushed down the link chain and can now be found in app-dev-2, which will then lead to app/v1.

If we are happy with our staged version, we can declare it as our most recent production version.

depl-help-release app

The reference in app-dev-1 will be copied to app-prod-1, which is also accessible through the pure app link.

We can also deploy a new version directly to the production link hierarchy.

depl-help-deploy app app/v3 prod

app-prod-1 will now link to app/v3, app-prod-2 will contain a reference to the former production version sitting in app/v1.

If we encounter problems with the most current version, which users might access through a route that goes to our app link, we can easily roll back to an older version.

depl-help-rollback app prod

This will set back app-prod-1 to what app-prod-2 linked to - in our case this means that app-prod-1 - and therefore app itself - will link to app/v1 again.

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.