chore(travis): more robust release detection

This commit is contained in:
Andy Joslin
2014-02-05 12:52:55 -05:00
parent e7eefeef91
commit 81bcf8d394
5 changed files with 18 additions and 12 deletions

View File

@@ -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

View File

@@ -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!"

View File

@@ -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!"
}

View File

@@ -1,4 +1,8 @@
echo "#####################################"
echo "# Update ionic-angular-cordova-seed #"
echo "#####################################"
ARG_DEFS=(
)

View File

@@ -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