GithubHelp home page GithubHelp logo

njestes / github-auto-deploy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from usgs-wim/github-auto-deploy

0.0 2.0 0.0 178 KB

a server that allows you to automatically deploy the latest version of your github project at each git push

Home Page: http://logsol.github.com/Github-Auto-Deploy/

Python 99.66% Batchfile 0.34%

github-auto-deploy's Introduction

github-auto-deploy

Python webserver that listens for webhooks on a reposity and then does a pull to get latest code

forked from http://logsol.github.io/Github-Auto-Deploy/

Requires linux, apache

Project setup

Install required software

  • python
  • git
sudo apt-get install python git

Get Github Auto Deploy

Get a copy of this repo, store in "/opt". We can't keep this in the home dir because that is encrypted and doesn't stay running after logging out

cd /opt
git clone https://github.com/USGS-WiM/Github-Auto-Deploy.git

Start autodeploy as a background service

This command starts and keeps the service running as a background service

 /usr/bin/nohup python /opt/Github-Auto-Deploy/GitAutoDeploy.py > /dev/null 2>&1 &

Add a new project to auto-deploy

1. Get initial clones of repositories to be auto-deployed

This command will get a copy of the repository that will be the base for the deployment. Run this from your home folder, ie "/home/ubuntu"

cd /home/ubuntu
git clone https://github.com/USGS-WiM/StreamStats.git

2. Set up symobolic links for apache

This creates a symbolic link between the github repository in your home folder and the apache web server home folder. Here we can specify to only make the symbolic link from a specific folder in the github reposity, ie "/dist" in the example below.

ln -s /home/ubuntu/streamstats/dist /var/www/html/streamstats

3. Edit auto-deploy configuration file

Edit the file "/opt/Github-Auto-Deploy/GitAutoDeploy.conf.json"

sudo nano /opt/Github-Auto-Deploy/GitAutoDeploy.conf.json

add an object like:

{
   "url": "https://github.com/USGS-WiM/NSS",
   "path": "/home/ubuntu/NSS",
   "deploy": "echo deploying"
}

4. Set up webhook on Github.com

On the Github page go to a repository, then go to "Settings" on the right, then "Webhooks & Services", "Add webhook" under "Webhooks." Add the url of your machine + port (e.g. http://example.com:8001). Specify Content type as application/json. Leave the event as just the push event.

github-auto-deploy's People

Contributors

awigen avatar kumy avatar logsol avatar markdorison avatar marsmith avatar njestes avatar stuartcarnie avatar

Watchers

 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.