mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(travis): make release task testable
This commit is contained in:
@@ -11,6 +11,7 @@ function init {
|
||||
git config --global user.name 'Ionotron'
|
||||
git config --global user.email hi@ionicframework.com
|
||||
export GH_ORG=driftyco
|
||||
export RELEASE_REMOTE=origin
|
||||
else
|
||||
# For testing if we aren't on travis
|
||||
export TRAVIS_BUILD_NUMBER=$RANDOM
|
||||
@@ -19,6 +20,7 @@ function init {
|
||||
export TRAVIS_BRANCH=master
|
||||
# use your github username as GH_ORG to push to, and it will push to ORG/ionic-code, etc
|
||||
export GH_ORG=ajoslin
|
||||
export RELEASE_REMOTE=ajoslin
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -26,6 +28,7 @@ function run {
|
||||
cd ../..
|
||||
|
||||
echo "GH_ORG=$GH_ORG"
|
||||
echo "RELEASE_REMOTE=$RELEASE_REMOTE"
|
||||
echo "TRAVIS_BRANCH=$TRAVIS_BRANCH"
|
||||
echo "TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER"
|
||||
echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "##############################"
|
||||
echo "# Pushing release to $RELEASE_REMOTE #"
|
||||
echo "##############################"
|
||||
|
||||
# Inspired by AngularJS's finalize-version script
|
||||
# Run by travis when it detects a commit that changes package.json version
|
||||
|
||||
ARG_DEFS=(
|
||||
"[--remote=(.*)]"
|
||||
"--codename=(.*)"
|
||||
"--version=(.*)"
|
||||
)
|
||||
|
||||
function init {
|
||||
function run {
|
||||
cd ../..
|
||||
|
||||
REMOTE=$REMOTE || "origin"
|
||||
CODENAME=$(readJsonProp "package.json" "codename")
|
||||
|
||||
replaceJsonProp "bower.json" "version" "$VERSION"
|
||||
@@ -26,11 +28,11 @@ function init {
|
||||
cp -Rf dist/* release
|
||||
|
||||
git add -A
|
||||
git commit -m "release: v$VERSION \"$CODENAME\""
|
||||
git commit -m "finalize-release: v$VERSION \"$CODENAME\""
|
||||
git tag -f -m "v$VERSION" v$VERSION
|
||||
|
||||
git push $REMOTE master
|
||||
git push -q $REMOTE v$VERSION
|
||||
git push -q -f $RELEASE_REMOTE master
|
||||
git push -q -f $RELEASE_REMOTE v$VERSION
|
||||
|
||||
echo "-- v$VERSION \"$CODENAME\" pushed to ionic#master successfully!"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user