diff options
| author | Tobias Bosch | 2014-01-09 15:22:50 -0800 |
|---|---|---|
| committer | Tobias Bosch | 2014-01-09 15:29:02 -0800 |
| commit | b1d676b7f75441e28f68d00b5c3f89659dea252c (patch) | |
| tree | e45bfa88435ed125d1d483f3c61d23d5e907a626 /scripts/jenkins/release-after-cdn.sh | |
| parent | 9ddef840b665bd94a49102a4e3dbc433f7b29b9a (diff) | |
| download | angular.js-b1d676b7f75441e28f68d00b5c3f89659dea252c.tar.bz2 | |
chore(build): check cdn before executing the release-after-cdn script
Diffstat (limited to 'scripts/jenkins/release-after-cdn.sh')
| -rwxr-xr-x | scripts/jenkins/release-after-cdn.sh | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scripts/jenkins/release-after-cdn.sh b/scripts/jenkins/release-after-cdn.sh index 7623e177..44436c04 100755 --- a/scripts/jenkins/release-after-cdn.sh +++ b/scripts/jenkins/release-after-cdn.sh @@ -4,15 +4,9 @@ ARG_DEFS=( # require the git dryrun flag so the script can't be run without # thinking about this! "--git-push-dryrun=(true|false)" + "--cdn-version=(.*)" ) -function findLatestRelease { - # returns e.g. v1.2.7 - LATEST_TAG=$(git describe --abbrev=0 --tags) - # returns e.g. 1.2.7 - echo ${LATEST_TAG:1} -} - function init { NG_ARGS=("$@") if [[ ! $VERBOSE ]]; then @@ -23,14 +17,22 @@ function init { function phase { ACTION_ARG="--action=$1" - CDN_VERSION_ARG="--cdn-version=$LATEST_VERSION" + CDN_VERSION_ARG="--cdn-version=$CDN_VERSION" ./scripts/angular.js/publish-cdn-version.sh $ACTION_ARG $CDN_VERSION_ARG $VERBOSE_ARG ./scripts/angularjs.org/publish.sh $ACTION_ARG $CDN_VERSION_ARG $VERBOSE_ARG } +function checkCdn { + STATUS=$(curl http://ajax.googleapis.com/ajax/libs/angularjs/$CDN_VERSION/angular.min.js --write-out '%{http_code}' -o /dev/null -silent) + if [[ $STATUS != 200 ]]; then + echo "Could not find release $CDN_VERSION on CDN" + exit 1 + fi +} + function run { cd ../.. - LATEST_VERSION=$(findLatestRelease) + checkCdn phase prepare phase publish |
