Last active
August 29, 2015 13:56
-
-
Save twitchy/8876991 to your computer and use it in GitHub Desktop.
grunt-build-control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GRUNT-BUILD-CONTROL | |
// https://npmjs.org/package/grunt-build-control | |
// http://curtisblackwell.com/blog/my-deploy-method-brings-most-of-the-boys-to-the-yard | |
// | |
// use grunt to auto push /dist to live, stage, whatever on build | |
// | |
- npm install grunt-build-control --save-dev | |
- // grunt.loadNpmTasks('grunt-build-control'); ( not needed with yeoman ) | |
- configuration: | |
// Project configuration. | |
grunt.initConfig({ | |
// Various Grunt tasks... | |
buildcontrol: { | |
options: { | |
dir: 'dist', | |
commit: true, | |
push: true, | |
message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%' | |
}, | |
pages: { | |
options: { | |
remote: 'git@github.com:example_user/example_webapp.git', | |
branch: 'gh-pages' | |
} | |
}, | |
heroku: { | |
options: { | |
remote: 'git@heroku.com:example-heroku-webapp-1988.git', | |
branch: 'master' | |
} | |
}, | |
myServer: { | |
options: { | |
remote: '{{ myServer }}', | |
branch: 'master' | |
} | |
}, | |
local: { | |
options: { | |
remote: '../', | |
branch: 'build' | |
} | |
} | |
} | |
}); | |
grunt.registerTask('deploy', [ | |
// Collection of tasks that build code to the 'dist' directory... | |
buildcontrol:myServer | |
]); | |
// Add post-receive hook to output /dist on live | |
// hooks/post-receive | |
// path to site = /home/.../.../public_html/ | |
GIT_WORK_TREE=/path/to/site git checkout -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment