-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(deploy): deploy to sharvit/node-mdl-starter
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
GITHUB_USERNAME="sharvit" | ||
PROJECT_NAME="node-mdl-starter" | ||
STARTER_GH_TOKEN=$STARTER_GH_TOKEN | ||
STARTER_NPM_TOKEN=$STARTER_NPM_TOKEN | ||
GENERATOR_NODE_MDL_VERSION=$TRAVIS_TAG | ||
|
||
if [ `echo $GENERATOR_NODE_MDL_VERSION | tail -c 3` == ".0" ] | ||
then | ||
COMMIT_TYPE="feat" | ||
else | ||
COMMIT_TYPE="fix" | ||
fi | ||
|
||
yarn global add yo generator-node-mdl | ||
|
||
git clone git@github.com:$GITHUB_USERNAME/$PROJECT_NAME.git | ||
cd $PROJECT_NAME | ||
|
||
yo node-mdl \ | ||
--npmToken $STARTER_NPM_TOKEN \ | ||
--githubToken $STARTER_GH_TOKEN \ | ||
--projectName $PROJECT_NAME \ | ||
--description "Generated by generator-node-mdl" \ | ||
--name "Avi Sharvit" \ | ||
--email "sharvita@gmail.com" \ | ||
--website "https://sharvit.github.io" \ | ||
--githubUsername $GITHUB_USERNAME \ | ||
--noDefaults \ | ||
--githubTemplates \ | ||
--coveralls \ | ||
--travisCI \ | ||
--npmDeploy \ | ||
--semanticRelease \ | ||
--force | ||
|
||
if [ $( git diff origin/master | wc -l ) -ne 0 ] | ||
then | ||
git reset origin/master | ||
git add . | ||
git commit -m "${COMMIT_TYPE}(init): updated using generator-node-mdl ${GENERATOR_NODE_MDL_VERSION} 🔥" | ||
git push origin master | ||
|
||
echo "Deployed to: https://github.com/${GITHUB_USERNAME}/${PROJECT_NAME}" | ||
else | ||
echo "Project node-mdl-starter hasn't changed afet running generator-node-mdl ${GENERATOR_NODE_MDL_VERSION}" | ||
echo "Nothing to deploy" | ||
fi |