Permalink
Browse files

Add grunt/shell.js to complete grunt deploy tasks

- Adds grunt/shell.js file, containing the commands grunt by grunt deploy
task.
- This command should work regardless of the state of gh-pages, if it's
even been created, and should exclude node_modules and bower_components
from the cleanup step.
  • Loading branch information...
bengitscode committed Jun 7, 2017
1 parent bd765b0 commit cbb51bc14a3bdf1ce4bfb348b7e6763faad588b7
Showing with 42 additions and 0 deletions.
  1. +42 −0 grunt/shell.js
@@ -0,0 +1,42 @@
'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',
'git clean -x -d --force --exclude=node_modules',
'git checkout master'
].join(' && ')
}
}

0 comments on commit cbb51bc

Please sign in to comment.