GithubHelp home page GithubHelp logo

git-auto-deploy-1's Introduction

Git Auto Deploy

This tool helps to automatically deploy stuff from Github to a server.
This simplifies the deployment of configuration and application updates.

Usage

Using an executable from releases:

Option: App Authentication

  1. Create an Github app under
    https://github.com/settings/developers
    or
    https://github.com/organizations/[ORGANIZATION]/settings/apps
  2. Set Repository permissions for "Contents" to "Access: Read-only"
  3. Install App to required Repositories (in menu: Install App)
  4. Create Private Key and save *.pem to your computer (in menu: General)
  5. Create a config file f.E. config/default.json (see config/example.json)
  6. To use Sentry add a file called sentry.txt at the same place as config file (f.E. config/sentry.txt)
  7. Run:

./git-auto-deploy /path/to/config.json

Option: Token Authentication (not recommended)

  1. Create a token under https://github.com/settings/tokens/new with scope: "repo"
  2. Create a config file f.E. config/default.json (see config/example.json)
  3. To use Sentry add a file called sentry.txt at the same place as config file (f.E. config/sentry.txt)
  4. Run:

./git-auto-deploy /path/to/config.json

Install as a service

The following lines of code helps to install git-auto-deploy as a cronjob (adapt that for windows of osx)

sudo mkdir /opt/git-auto-deploy
cd /opt/git-auto-deploy
sudo wget https://github.com/macherstube/git-auto-deploy/releases/download/v0.0.12/git-auto-deploy_linux -O git-auto-deploy_linux
sudo chmod 770 git-auto-deploy_linux
echo $'#!/bin/bash\n\n' | sudo tee postscript.sh > /dev/null
sudo chmod 770 postscript.sh

sudo mkdir /etc/git-auto-deploy
cd /etc/git-auto-deploy
echo $'{\n  "USERNAME": "",\n  "REPOSITORY": "",\n  "PRIVATEKEY": "/etc/git-auto-deploy/default.pem",\n  "APPID": 0,\n  "AUTHTOKEN": "",\n  "ASSETREGEX": "",\n  "DESTINATIONDIR": "",\n  "UNZIPDIR": "",\n  "POSTSCRIPT": "/opt/git-auto-deploy/postscript.sh"\n}' | sudo tee default.json > /dev/null
sudo chmod 600 default.json
sudo cp /path/to/downloaded/private-key.pem /etc/git-auto-deploy/default.pem
sudo chmod 400 default.pem

sudo nano /etc/git-auto-deploy/default.json
sudo nano /opt/git-auto-deploy/postscript.sh

sudo crontab -l > /tmp/cron_backup
sudo echo "*/5 * * * * /opt/git-auto-deploy/git-auto-deploy_linux /etc/git-auto-deploy/default.json" >> /tmp/cron_backup
sudo crontab /tmp/cron_backup
sudo rm /tmp/cron_backup

git-auto-deploy-1's People

Contributors

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