2013-12-13 20:49:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2014-02-04 18:25:10 +00:00
|
|
|
# tags the current commit as a release and publishes all artifacts to
|
|
|
|
|
# the different repositories.
|
|
|
|
|
# Note: This will also works if the commit is in the past!
|
|
|
|
|
|
2013-12-14 04:02:15 +00:00
|
|
|
echo "#################################"
|
2014-02-04 18:25:10 +00:00
|
|
|
echo "#### cut release ############"
|
2013-12-14 04:02:15 +00:00
|
|
|
echo "#################################"
|
|
|
|
|
|
2014-01-06 20:19:51 +00:00
|
|
|
ARG_DEFS=(
|
2014-01-09 22:39:48 +00:00
|
|
|
# require the git dryrun flag so the script can't be run without
|
|
|
|
|
# thinking about this!
|
|
|
|
|
"--git-push-dryrun=(true|false)"
|
2014-02-04 18:25:10 +00:00
|
|
|
# The sha to release. Needs to be the same as HEAD.
|
|
|
|
|
# given as parameter to double check.
|
|
|
|
|
"--commit-sha=(.*)"
|
|
|
|
|
# the version number of the release.
|
|
|
|
|
# e.g. 1.2.12 or 1.2.12-rc.1
|
|
|
|
|
"--version-number=([0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.[0-9]+)?)"
|
|
|
|
|
# the codename of the release
|
|
|
|
|
"--version-name=(.+)"
|
2014-01-06 20:19:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function init {
|
2014-02-04 18:25:10 +00:00
|
|
|
if [[ $(git rev-parse --short HEAD) != $COMMIT_SHA ]]; then
|
|
|
|
|
echo "HEAD is not at $COMMIT_SHA"
|
|
|
|
|
usage
|
|
|
|
|
fi
|
|
|
|
|
|
2014-01-07 22:47:03 +00:00
|
|
|
if [[ ! $VERBOSE ]]; then
|
|
|
|
|
VERBOSE=false
|
|
|
|
|
fi
|
|
|
|
|
VERBOSE_ARG="--verbose=$VERBOSE"
|
2014-02-04 18:25:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function build {
|
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
|
|
npm install --color false
|
|
|
|
|
grunt ci-checks package --no-color
|
|
|
|
|
|
|
|
|
|
cd $SCRIPT_DIR
|
2014-01-06 20:19:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function phase {
|
2014-01-07 22:47:03 +00:00
|
|
|
ACTION_ARG="--action=$1"
|
2014-02-04 18:25:10 +00:00
|
|
|
../angular.js/tag-release.sh $ACTION_ARG $VERBOSE_ARG\
|
|
|
|
|
--version-number=$VERSION_NUMBER --version-name=$VERSION_NAME\
|
|
|
|
|
--commit-sha=$COMMIT_SHA
|
|
|
|
|
|
|
|
|
|
if [[ $1 == "prepare" ]]; then
|
|
|
|
|
# The build requires the tag to be set already!
|
|
|
|
|
build
|
|
|
|
|
fi
|
|
|
|
|
|
2014-01-07 22:47:03 +00:00
|
|
|
../code.angularjs.org/publish.sh $ACTION_ARG $VERBOSE_ARG
|
|
|
|
|
../bower/publish.sh $ACTION_ARG $VERBOSE_ARG
|
2014-02-04 18:25:10 +00:00
|
|
|
../angular-seed/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true
|
|
|
|
|
../angular-phonecat/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true
|
2014-01-06 20:19:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function run {
|
|
|
|
|
# First prepare all scripts (build, test, commit, tag, ...),
|
|
|
|
|
# so we are sure everything is all right
|
|
|
|
|
phase prepare
|
|
|
|
|
# only then publish to github
|
|
|
|
|
phase publish
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
source $(dirname $0)/../utils.inc
|