Skip to content

Instantly share code, notes, and snippets.

@cognitom
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cognitom/0a55df6fcf8f10f0dbb5 to your computer and use it in GitHub Desktop.
Save cognitom/0a55df6fcf8f10f0dbb5 to your computer and use it in GitHub Desktop.
gulp = require 'gulp'
path = require 'path'
Shipit = require 'shipit-cli'
shipitDeploy = require 'shipit-deploy'
shipit = new Shipit()
shipitDeploy shipit
shipit.config =
servers: '192.168.0.100'
workspace: '/tmp/github-monitor'
deployTo: '/var/www'
repositoryUrl: 'https://github.com/cognitom/somewhere.git'
branch: 'master'
ignores: ['.git', 'node_modules']
rsync: ['--del']
keepReleases: 5
shallowClone: true
shipit.on 'updated', ->
dir = path.join shipit.releasesPath, shipit.releaseDirname
shipit.remote "cd #{ dir } && npm i && npm run build"
gulp.task 'deploy', ->
shipit.initialize()
shipit.start 'deploy'
gulp.task 'predeploy', ->
shipit.initialize()
shipit.remote "sudo mkdir /var/www -m 777"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment