Giter Site home page Giter Site logo

deploy's Introduction

Deploy

Basic deployment runner

Install

git clone [email protected]:rwarasaurus/deploy.git /opt/deploy
chmod +x /opt/deploy/run.py
ln -s /opt/deploy/run.py /bin/deployer

Setup

Copy the config-sample.yml to config.yml and edit for your project.

cp /opt/deploy/config-sample.yml /my/deployments/myproject/config.yml
cd /my/deployments/myproject
mkdir ./release
mkdir ./static
ssh-keygen -t rsa -b 4096 -f ./is_rsa
nano ./config.yml

Configuration

Parameters that are required in the yaml config file

  • repo_branch Branch name to clone
  • repo_url Git repo url
  • deploy_key Path of private key on the filesystem to use when cloning
  • static_path Path to a folder where static assets are copied to the release folder
  • release_path Path to the folder that will contain all the releases
  • symlink Path to symlink to the release
  • deploy_user System user account which all files should be changed to
  • deploys_to_keep Number of releases to keep
  • pre_scripts List of command to run before the symlink is updated
  • post_scripts List of commands to run once the symlink has been updated

Variables that can be substituted in pre_scripts and post_scripts

  • $deploy_path The current release path
  • $repo_branch Branch name
  • $repo_url Git repo url
  • $hostname The systems hostname

Running

Using the run.py file passing the first argument as the location of the config.yml file

python /opt/deploy/run.py /my/deployments/myproject/config.yml

Or if you have symlinked the run.py file to /bin/deployer

deployer /my/deployments/myproject/config.yml

Rollback

Rollback to another release, for example 20171221173000

deployer /my/deployments/myproject/config.yml 20171221173000

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.