diff options
| author | Tobias Bosch | 2014-02-04 10:25:10 -0800 | 
|---|---|---|
| committer | Igor Minar | 2014-02-04 16:20:22 -0800 | 
| commit | 8761ddc0e382f48fa0317c88bd6426997d24037f (patch) | |
| tree | c4fe2feced1044285a3517793bac31ea69fcd504 /scripts/jenkins/release.sh | |
| parent | 058842ad04009c306f9ac1403f3b8e354af523bd (diff) | |
| download | angular.js-8761ddc0e382f48fa0317c88bd6426997d24037f.tar.bz2 | |
chore(release): be able to release any commit
The version information is now stored only in the tags.
By this we are able to release commits in the past, which
have already been tested, so we don't need a code freeze
or run tests any more. This is also the first step for
letting Travis do the releases in the future.
The package.json now contains the new
property 'branchVersion' that defines which tags are
valid on this branch.
Closes #6116
Diffstat (limited to 'scripts/jenkins/release.sh')
| -rwxr-xr-x | scripts/jenkins/release.sh | 51 | 
1 files changed, 38 insertions, 13 deletions
| diff --git a/scripts/jenkins/release.sh b/scripts/jenkins/release.sh index 744a1a28..8c1e46bc 100755 --- a/scripts/jenkins/release.sh +++ b/scripts/jenkins/release.sh @@ -1,38 +1,63 @@  #!/bin/bash +# 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! +  echo "#################################" -echo "#### Cut release ################" +echo "#### cut release     ############"  echo "#################################"  ARG_DEFS=( -  "--next-version-type=(patch|minor|major)" -  "--next-version-name=(.+)"    # require the git dryrun flag so the script can't be run without    # thinking about this!    "--git-push-dryrun=(true|false)" -  "[--no-test=(true|false)]" +  # 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=(.+)"  )  function init { -  NG_ARGS=("$@") +  if [[ $(git rev-parse --short HEAD) != $COMMIT_SHA ]]; then +    echo "HEAD is not at $COMMIT_SHA" +    usage +  fi +    if [[ ! $VERBOSE ]]; then      VERBOSE=false    fi -  if [[ ! $NO_TEST ]]; then -    NO_TEST=false -  fi    VERBOSE_ARG="--verbose=$VERBOSE" -  NO_TEST_ARG="--no_test=$NO_TEST" +} + +function build { +  cd ../.. + +  npm install --color false +  grunt ci-checks package --no-color + +  cd $SCRIPT_DIR  }  function phase {    ACTION_ARG="--action=$1" -  ../angular.js/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG \ -      --next-version-type=$NEXT_VERSION_TYPE --next-version-name=$NEXT_VERSION_NAME +  ../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 +    ../code.angularjs.org/publish.sh $ACTION_ARG $VERBOSE_ARG    ../bower/publish.sh $ACTION_ARG $VERBOSE_ARG -  ../angular-seed/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG -  ../angular-phonecat/publish.sh $ACTION_ARG $VERBOSE_ARG $NO_TEST_ARG +  ../angular-seed/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true +  ../angular-phonecat/publish.sh $ACTION_ARG $VERBOSE_ARG --no-test=true  }  function run { | 
