Permalink
Browse files

Merge branch 'grunt-deploy'

  • Loading branch information...
bengitscode committed Aug 17, 2017
2 parents a312a09 + a19bdae commit dc48723559f86212164863787b146f2eeb2d03cb
Showing with 57 additions and 0 deletions.
  1. +10 −0 grunt/aliases.json
  2. +46 −0 grunt/shell.js
  3. +1 −0 package.json
@@ -1,5 +1,15 @@
{
"default": ["nag"],
"nag": ["jshint", "jsonlint:all", "jscs:status"],
"deploy": [
"shell:git-is-clean",
"shell:git-checkout-master",
"shell:git-push-master",
"shell:deploy-prepare",
"shell:deploy-dist",
"shell:deploy-publish",
"shell:clean-gh-pages",
"shell:return-to-master"
],
"reformat": ["jscs:write"]
}
@@ -0,0 +1,46 @@
'use strict'

const ghPagesList = ['dist/']

module.exports = {
'git-is-clean': {
// `$(git status --porcelain)` will evaluate to the empty string if the
// working directory is clean.
// `test -z` will exit 0 (true) if its argument is an empty string.
// If it doesn't exit true, `(git status && false)` will show why the
// repository isn't clean and exit false causing the grunt tasks to end.
command: 'test -z "$(git status --porcelain)" || (git status && false)'
},
'git-push-master': {
command: 'git push origin master'
},
'git-checkout-master': {
command: 'git checkout master'
},
'deploy-prepare': {
command: [
'git branch -D gh-pages || echo "so not removed"',
'git checkout --orphan gh-pages',
'git rm --cached \'*\'',
'ember build --environment=production'
].join(' && ')
},
'deploy-dist': {
command: [
'git add --force dist/',
'git commit -m "deploy task"'
].join(' && ')
},
'deploy-publish': {
command: [
'git push origin :gh-pages || echo "so not removed"',
'git subtree push --prefix dist origin gh-pages',
].join(' && ')
},
'clean-gh-pages': {
command: 'git clean -x -d --force --exclude=node_modules --exclude=bower_components'
},
'return-to-master': {
command: 'git checkout master'
},
}
@@ -50,6 +50,7 @@
"grunt-contrib-jshint": "^1.1.0",
"grunt-jscs": "^3.0.1",
"grunt-jsonlint": "^1.1.0",
"grunt-shell": "^2.1.0",
"load-grunt-config": "^0.19.2",
"loader.js": "^4.1.0",
"time-grunt": "^1.4.0"

0 comments on commit dc48723

Please sign in to comment.