Skip to content

MustHash/shepherd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shepherd

GitHub Post-Hook server with project deployment

Instructions

$ git clone https://github.com/MustHash/shepherd.git
$ cd shepherd
$ npm install

Edit the config.json file to match your preferences.

$ npm start

Options

{
    "log": "../logs/shepherd.log",
    "repository": "MustHash/fuckyourcode.com",
    "branch": "master",
    "repository-folder": "../public",
    "port": 3001,
    "post-script": ""
}
  • log : where the log file will be written
  • repository : which repository should the server pay attention
  • branch : which branch should the server pay attention
  • repository-folder : where should shepherd issue the git pull command
  • port : which port should the server listen to
  • post-script : a given script that will be required when the pull is successful

Step-by-step instructions

The directories chosen are mainly examples, adapt to your needs.

Clone your repository on you server and checkout the correct branch

cd /var/www/fuckyourcode.com
git clone https://github.com/MustHash/fuckyourcode.com.git .
git checkout deploy-branch

Set up the shepherd server

cd /var/www/private/shepherd
npm start

Notice that in the config.json file the repository folder should match the /var/www/fuckyourcode.com

Issues

If the git pull command keeps asking you for a password, create a ssh keys-pair without passphrase and add the key to the Deploy key in the repository settings (https://github.com/{Username}/{repository}/settings/keys).

About

GitHub post-hook server with git pull deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published