2014-01-09 22:39:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
ARG_DEFS=(
|
|
|
|
|
# require the git dryrun flag so the script can't be run without
|
|
|
|
|
# thinking about this!
|
|
|
|
|
"--git-push-dryrun=(true|false)"
|
2014-01-09 23:22:50 +00:00
|
|
|
"--cdn-version=(.*)"
|
2014-01-09 22:39:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function init {
|
|
|
|
|
NG_ARGS=("$@")
|
|
|
|
|
if [[ ! $VERBOSE ]]; then
|
|
|
|
|
VERBOSE=false
|
|
|
|
|
fi
|
|
|
|
|
VERBOSE_ARG="--verbose=$VERBOSE"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function phase {
|
|
|
|
|
ACTION_ARG="--action=$1"
|
2014-01-09 23:22:50 +00:00
|
|
|
CDN_VERSION_ARG="--cdn-version=$CDN_VERSION"
|
2014-01-09 22:39:48 +00:00
|
|
|
./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
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-09 23:22:50 +00:00
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-09 22:39:48 +00:00
|
|
|
function run {
|
|
|
|
|
cd ../..
|
2014-01-09 23:22:50 +00:00
|
|
|
checkCdn
|
2014-01-09 22:39:48 +00:00
|
|
|
|
|
|
|
|
phase prepare
|
|
|
|
|
phase publish
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
source $(dirname $0)/../utils.inc
|