From 81bcf8d3942c7c88a70201d72edba1796d35166c Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Wed, 5 Feb 2014 12:52:55 -0500 Subject: [PATCH] chore(travis): more robust release detection --- scripts/cdn/publish.sh | 4 ---- scripts/release/finalize-version.sh | 4 ++-- scripts/release/initialize-new-version.sh | 2 +- scripts/seed/publish.sh | 4 ++++ scripts/travis/ci.sh | 16 +++++++++++----- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/scripts/cdn/publish.sh b/scripts/cdn/publish.sh index 85849909ad..c7389d651e 100755 --- a/scripts/cdn/publish.sh +++ b/scripts/cdn/publish.sh @@ -36,10 +36,6 @@ function run { # Create a version.txt file with the version and codename echo "$VERSION $CODENAME" > version.txt - echo "-- Zipping build files..." - cd $IONIC_CODE_DIR - zip -r -q $VERSION_DIR/ionic-$VERSION_LABEL.zip $VERSION_DIR - echo "-- Generating versions.json..." cd $IONIC_CODE_DIR/builder python ./generate.py > /dev/null diff --git a/scripts/release/finalize-version.sh b/scripts/release/finalize-version.sh index 5b495b3288..3584aca9e2 100755 --- a/scripts/release/finalize-version.sh +++ b/scripts/release/finalize-version.sh @@ -43,8 +43,8 @@ function publish { VERSION=$(readJsonProp "package.json" "version") - git push -q origin master - git push -q origin v$VERSION + git push origin master + git push origin v$VERSION echo "-- Version published as v$VERSION successfully!" diff --git a/scripts/release/initialize-new-version.sh b/scripts/release/initialize-new-version.sh index 3148b031aa..cb6e36d9f3 100755 --- a/scripts/release/initialize-new-version.sh +++ b/scripts/release/initialize-new-version.sh @@ -28,7 +28,7 @@ function run { git add package.json git commit -m "chore(post-release): start v$VERSION" - git push -q origin master + git push origin master echo "Version initialized & published as v$VERSION successfully!" } diff --git a/scripts/seed/publish.sh b/scripts/seed/publish.sh index eb6f87c9bf..81ab3ea17c 100755 --- a/scripts/seed/publish.sh +++ b/scripts/seed/publish.sh @@ -1,4 +1,8 @@ +echo "#####################################" +echo "# Update ionic-angular-cordova-seed #" +echo "#####################################" + ARG_DEFS=( ) diff --git a/scripts/travis/ci.sh b/scripts/travis/ci.sh index dd17c529ca..3df6adbd60 100755 --- a/scripts/travis/ci.sh +++ b/scripts/travis/ci.sh @@ -16,6 +16,7 @@ function init { export TRAVIS_BRANCH=master export TRAVIS_BUILD_NUMBER=$RANDOM export TRAVIS_PULL_REQUEST=false + export TRAVIS_COMMIT=$(git rev-parse HEAD) # use your github username as GH_ORG to push to, and it will push to ORG/ionic-code, etc export GH_ORG=ajoslin fi @@ -28,6 +29,7 @@ function run { echo "TRAVIS_BRANCH=$TRAVIS_BRANCH" echo "TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER" echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST" + echo "TRAVIS_COMMIT=$TRAVIS_COMMIT" # Jshint & check for stupid mistakes grunt jshint ddescribe-iit merge-conflict @@ -44,14 +46,18 @@ function run { exit 0 fi - # If latest commit message starts with chore(release): it's a release - COMMIT_MESSAGE=$(git log --format=%B | head -c 15) - + # If latest commit message starts with 'chore(release):' it's a release + COMMIT_MESSAGE=$(git log --format=%B -n 1 $TRAVIS_COMMIT | head -c 15) + if [[ "$COMMIT_MESSAGE" == "chore(release):" ]]; then IS_RELEASE=true - echo "-- Pushing out a new full release." + echo "##################################" + echo "# Pushing out a new full release #" + echo "##################################" else - echo "-- Pushing out a new nightly build." + echo "#####################################" + echo "# Pushing out a new nightly release #" + echo "#####################################" ./scripts/travis/bump-nightly-version.sh fi