This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(travis): Updated travis to use their conditions (#306)
- Loading branch information
Showing
3 changed files
with
15 additions
and
45 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 |
---|---|---|
@@ -1,27 +1,16 @@ | ||
# Script to release to NPM and publish tag | ||
|
||
# Exit if we are a scheduled build | ||
if [[ $TRAVIS_EVENT_TYPE == "cron" ]] | ||
then | ||
echo This is a cron build - exiting | ||
exit 0 | ||
fi | ||
git remote rm origin | ||
git remote add origin https://SwiftDevOps:${GH_TOKEN}@github.com/IBM-Swift/generator-swiftserver | ||
VERSION=`node -e "console.log(require('./package.json').version);"` | ||
echo "Creating release ${VERSION}" | ||
git tag $VERSION && git push origin $VERSION || true | ||
# Merge back into develop and push those changes | ||
git fetch origin && git checkout develop && git merge origin/master && git push origin develop | ||
# npm publish | ||
|
||
if [[ $TRAVIS_BRANCH == "master" ]] && [[ $TRAVIS_PULL_REQUEST == "false" ]]; then | ||
git remote rm origin | ||
git remote add origin https://SwiftDevOps:${GH_TOKEN}@github.com/IBM-Swift/generator-swiftserver | ||
VERSION=`node -e "console.log(require('./package.json').version);"` | ||
echo "Creating release ${VERSION}" | ||
git tag $VERSION && git push origin $VERSION || true | ||
# Merge back into develop and push those changes | ||
git fetch origin && git checkout develop && git merge origin/master && git push origin develop | ||
# npm publish | ||
|
||
# Deleting the old release branch | ||
BRANCH_TO_DELETE=updateTo$VERSION | ||
echo Deleting $BRANCH_TO_DELETE | ||
curl -u SwiftDevOps:${GH_TOKEN} -X DELETE -H "Accept: application/vnd.github.loki-preview+json" "https://api.github.com/repos/IBM-Swift/generator-swiftserver/branches/$BRANCH_TO_DELETE/protection" | ||
git push origin :$BRANCH_TO_DELETE | ||
else | ||
echo "This not on master or a push to master - exiting" | ||
fi | ||
# Deleting the old release branch | ||
BRANCH_TO_DELETE=updateTo$VERSION | ||
echo Deleting $BRANCH_TO_DELETE | ||
curl -u SwiftDevOps:${GH_TOKEN} -X DELETE -H "Accept: application/vnd.github.loki-preview+json" "https://api.github.com/repos/IBM-Swift/generator-swiftserver/branches/$BRANCH_TO_DELETE/protection" | ||
git push origin :$BRANCH_TO_DELETE |
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