ci: delete obsolete files and move scripts/ci-lite/ to scripts/ci/

This commit is contained in:
Igor Minar 2017-03-05 01:32:09 -08:00 committed by Igor Minar
parent a24e652f2b
commit 91fe3aadbc
34 changed files with 5 additions and 515 deletions

View File

@ -1,34 +0,0 @@
#!/bin/bash
set -e -o pipefail
echo '*******************'
echo '** AFTER_SCRIPT **'
echo '*******************'
if [ "$MODE" = "saucelabs" ]; then
./scripts/sauce/sauce_connect_teardown.sh
fi
if [ "$MODE" = "browserstack" ]; then
./scripts/browserstack/teardown_tunnel.sh
fi
echo '---------------------'
echo '-- WAIT FOR OTHERS --'
echo '---------------------'
python ./scripts/ci/travis_after_all.py
. .to_export_back
echo BUILD_LEADER=$BUILD_LEADER
echo BUILD_AGGREGATE_STATUS=$BUILD_AGGREGATE_STATUS
if [ "$BUILD_LEADER" = "YES" ]; then
if [ "$BUILD_AGGREGATE_STATUS" = "others_succeeded" ]; then
./scripts/ci/presubmit-queue-success.sh
else
echo "ERROR: Some Failed, not submitting"
fi
else
echo "ERROR: Other builds have not finished, not submitting"
fi

View File

@ -1,42 +0,0 @@
#!/bin/bash
set -e
CPUPATH=/sys/devices/system/cpu
WAKE_LOCK_NAME=ngperf
set_governor() {
echo "Setting CPU frequency governor to \"$1\""
adb shell 'for f in '$CPUPATH'/cpu*/cpufreq/scaling_governor ; do echo '$1' > $f; done'
}
wake_lock() {
echo "Setting wake lock $WAKE_LOCK_NAME"
adb shell "echo $WAKE_LOCK_NAME > /sys/power/wake_lock"
}
wake_unlock() {
echo "Removing wake lock $WAKE_LOCK_NAME"
adb shell "echo $WAKE_LOCK_NAME > /sys/power/wake_unlock"
}
case "$1" in
(performance)
set_governor "performance"
;;
(powersave)
set_governor "powersave"
;;
(ondemand)
set_governor "ondemand"
;;
(wakelock)
wake_lock
;;
(wakeunlock)
wake_unlock
;;
(*)
echo "Usage: $0 performance|powersave|ondemand|wakelock|wakeunlock"
exit 1
;;
esac

View File

@ -1,37 +0,0 @@
#!/bin/bash
set -ex
MODE=$1
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
if [ "$MODE" = "dart_ddc" ]; then
${SCRIPT_DIR}/build_$MODE.sh
elif [[ $MODE = saucelabs* ]] ; then
${SCRIPT_DIR}/test_saucelabs.sh $MODE
elif [[ $MODE = browserstack* ]] ; then
${SCRIPT_DIR}/test_browserstack.sh $MODE
elif [ "$MODE" = "lint" ]; then
./node_modules/.bin/gulp static-checks
elif [ "$MODE" = "build_only" ]; then
${SCRIPT_DIR}/build_js.sh
${SCRIPT_DIR}/build_dart.sh
elif [ "$MODE" = "typescript_next" ]; then
# Ignore complaints about unsatisfied peer deps
npm install typescript@next || true
${SCRIPT_DIR}/build_js.sh
# Run typings test using the GA release of TypeScript
# This ensures that users aren't forced onto beta/nightly
npm install typescript@1.8.9
./node_modules/.bin/gulp \!test.typings
elif [ "$MODE" = "payload" ]; then
source ${SCRIPT_DIR}/env_dart.sh
./node_modules/.bin/gulp test.payload.dart/ci
node --max-old-space-size=2000 ./node_modules/.bin/gulp test.payload.js/ci
else
${SCRIPT_DIR}/build_$MODE.sh
${SCRIPT_DIR}/test_$MODE.sh
fi

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
# this is needed because we're running JS tests in Dartium too
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
node --max-old-space-size=2000 ./node_modules/.bin/gulp build.js --useBundles

View File

@ -1,15 +0,0 @@
#!/bin/bash
set -e
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR
if [[ $PERF_BROWSERS =~ .*Android.* || $E2E_BROWSERS =~ .*Android.* ]]
then
adb root usb
adb wait-for-device devices
adb reverse tcp:8001 tcp:8001
adb reverse tcp:8002 tcp:8002
./android_cpu.sh performance
./android_cpu.sh wakelock
fi

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/usr/bin/env bash
set -e -x set -u -e -o pipefail
# Setup environment # Setup environment
cd `dirname $0` readonly thisDir=$(cd $(dirname $0); pwd)
source ../ci-lite/env.sh source ${thisDir}/_travis-fold.sh
# This script basically follows the instructions to download an old version of Chromium: https://www.chromium.org/getting-involved/download-chromium # This script basically follows the instructions to download an old version of Chromium: https://www.chromium.org/getting-involved/download-chromium
@ -80,6 +80,6 @@ if [[ "$EXISTING_VERSION" != "$CHROMIUM_VERSION" ]]; then
fi fi
if [[ "$CHROMIUM_VERSION" != "$LATEST_CHROMIUM_VERSION" ]]; then if [[ "$CHROMIUM_VERSION" != "$LATEST_CHROMIUM_VERSION" ]]; then
echo "New version of Chromium available. Update install_chromium.sh with build number: ${LATEST_CHROMIUM_VERSION}" echo "New version of Chromium available. Update install-chromium.sh with build number: ${LATEST_CHROMIUM_VERSION}"
fi fi

View File

@ -1,14 +0,0 @@
#!/bin/bash
platform=`uname`
if [[ "$platform" == 'Linux' ]]; then
`google-chrome --js-flags="--expose-gc"`
elif [[ "$platform" == 'Darwin' ]]; then
`/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary \
--enable-memory-info \
--enable-precise-memory-info \
--enable-memory-benchmarking \
--js-flags="--expose-gc --allow-natives-syntax" \
--disable-web-security \
--remote-debugging-port=9222`
fi

View File

@ -1,21 +0,0 @@
#!/bin/bash
set -e -o pipefail
if [ "$TRAVIS_REPO_SLUG" = "angular/angular" ]; then
if [[ $TRAVIS_BRANCH == "presubmit-"* ]]; then
echo '*********************'
echo '** PRESUBMIT SETUP **'
echo '*********************'
git config credential.helper "store --file=.git/credentials"
# travis encrypt GITHUB_TOKEN_ANGULAR=??? --repo=angular/angular
echo "https://${GITHUB_TOKEN_ANGULAR}:@github.com" > .git/credentials
git config user.name "`git --no-pager show -s --format='%cN' HEAD`"
git config user.email "`git --no-pager show -s --format='%cE' HEAD`"
git remote add upstream https://github.com/angular/angular.git
git fetch upstream master
git rebase upstream/master
fi
fi

View File

@ -1,52 +0,0 @@
#!/bin/bash
set -e -o pipefail
# If we're on the presubmit branch, the dev Dart release, and all unit
# tests pass, merge the presubmit branch into master and push it.
CHANNEL=`echo $JOB | cut -f 2 -d -`
SHA=`git rev-parse HEAD`
echo Current channel is: $CHANNEL
echo Current branch is: $TRAVIS_BRANCH
echo Test result is: $TRAVIS_TEST_RESULT
if [ "$TRAVIS_REPO_SLUG" = "angular/angular" ]; then
if [ $TRAVIS_TEST_RESULT -eq 0 ] && [[ $TRAVIS_BRANCH == "presubmit-"* ]]; then
echo '***************'
echo '** PRESUBMIT **'
echo '***************'
echo
echo "Pushing HEAD to master..."
git stash
git fetch upstream master
git rebase upstream/master
if [[ $TRAVIS_BRANCH == *"-pr-"* ]]; then
PR_NO=`echo $TRAVIS_BRANCH | sed -e 's/^.*-pr-//'`
if echo $PR_NO | egrep -q '^[0-9]+$'; then
echo "Adding Closes #$PR_NO"
git filter-branch -f --msg-filter "cat /dev/stdin && echo && echo Closes \#$PR_NO" HEAD~1..HEAD
fi
fi
if git push upstream HEAD:master; then
echo "$TRAVIS_BRANCH has been merged into master, deleting..."
git push upstream :"$TRAVIS_BRANCH"
else
COMITTER_EMAIL=`git --no-pager show -s --format='%cE' HEAD`
echo Sending failure email to ${COMITTER_EMAIL}
mail \
-s "Failed to merge branch $TRAVIS_BRANCH to master" \
${COMMITTER_EMAIL} \
<< EOM
Your travis branch ${TRAVIS_BRANCH} failed!
https://travis-ci.org/angular/angular/builds/${TRAVIS_JOB_ID}
Please take a look.
EOM
fi
fi
fi

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -e
MODE=$1
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
./scripts/browserstack/start_tunnel.sh
./scripts/browserstack/waitfor_tunnel.sh
./node_modules/.bin/gulp build.js.dev
./node_modules/.bin/gulp test.unit.js.browserstack/ci --mode=$MODE

View File

@ -1,32 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
./node_modules/.bin/webdriver-manager update
function killServer () {
kill $serverPid
}
./node_modules/.bin/gulp serve.js.prod&
serverPid=$!
trap killServer EXIT
# wait for server to come up!
sleep 10
# Let protractor use default browser unless one is specified.
OPTIONS="";
if [[ -n "$E2E_BROWSERS" ]]; then
OPTIONS="--browsers=$E2E_BROWSERS";
fi
./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS
./node_modules/.bin/protractor protractor-js.conf.js $OPTIONS --benchmark --dryrun
./node_modules/.bin/protractor dist/js/cjs/benchpress/test/firefox_extension/conf.js

View File

@ -1,17 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
# Issue #945 Travis still uses Dartium, and hence needs the env setup.
# For local tests, when a developer doesn't have Dart, don't source env_dart.sh
if ${SCRIPT_DIR}/env_dart.sh 2>&1 > /dev/null ; then
source $SCRIPT_DIR/env_dart.sh
fi
./node_modules/.bin/gulp pre-test-checks
./node_modules/.bin/gulp test.js --browsers=${KARMA_JS_BROWSERS:-Chrome}
${SCRIPT_DIR}/test_e2e_js.sh

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -e
MODE=$1
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
./scripts/sauce/sauce_connect_setup.sh
./scripts/sauce/sauce_connect_block.sh
./node_modules/.bin/gulp build.js.dev
./node_modules/.bin/gulp test.unit.js.sauce/ci --mode=$MODE

View File

@ -1,98 +0,0 @@
import os
import json
import time
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER'
TRAVIS_BUILD_ID = 'TRAVIS_BUILD_ID'
POLLING_INTERVAL = 'LEADER_POLLING_INTERVAL'
build_id = os.getenv(TRAVIS_BUILD_ID)
polling_interval = int(os.getenv(POLLING_INTERVAL, '5'))
#assume, first job is the leader
is_leader = lambda job_number: job_number.endswith('.1')
if not os.getenv(TRAVIS_JOB_NUMBER):
# seems even for builds with only one job, this won't get here
log.fatal("Don't use defining leader for build without matrix")
exit(1)
elif is_leader(os.getenv(TRAVIS_JOB_NUMBER)):
log.info("This is a leader")
else:
#since python is subprocess, env variables are exported back via file
with open(".to_export_back", "w") as export_var:
export_var.write("BUILD_MINION=YES")
log.info("This is a minion")
exit(0)
class MatrixElement(object):
def __init__(self, json_raw):
self.allow_failure = json_raw['allow_failure']
self.is_finished = json_raw['finished_at'] is not None
self.is_succeeded = json_raw['result'] == 0
self.number = json_raw['number']
self.is_leader = is_leader(self.number)
def matrix_snapshot():
"""
:return: Matrix List
"""
response = urllib2.build_opener().open("https://api.travis-ci.org/builds/{0}".format(build_id)).read()
raw_json = json.loads(response)
matrix_without_leader = [MatrixElement(element) for element in raw_json["matrix"]]
return matrix_without_leader
def wait_others_to_finish():
def others_finished():
"""
Dumps others to finish
Leader cannot finish, it is working now
:return: tuple(True or False, List of not finished jobs)
"""
snapshot = matrix_snapshot()
finished = [el.is_finished for el in snapshot if not (el.is_leader or el.allow_failure)]
return reduce(lambda a, b: a and b, finished), [el.number for el in snapshot if
not el.is_leader and not el.is_finished]
while True:
finished, waiting_list = others_finished()
if finished: break
log.info("Leader waits for minions {0}...".format(waiting_list)) # just in case do not get "silence timeout"
time.sleep(polling_interval)
try:
wait_others_to_finish()
final_snapshot = matrix_snapshot()
log.info("Final Results: {0}".format([(e.number, e.is_succeeded, e.allow_failure) for e in final_snapshot]))
BUILD_AGGREGATE_STATUS = 'BUILD_AGGREGATE_STATUS'
others_snapshot = [el for el in final_snapshot if not (el.is_leader or el.allow_failure)]
if reduce(lambda a, b: a and b, [e.is_succeeded for e in others_snapshot]):
os.environ[BUILD_AGGREGATE_STATUS] = "others_succeeded"
elif reduce(lambda a, b: a and b, [not e.is_succeeded for e in others_snapshot]):
log.error("Others Failed")
os.environ[BUILD_AGGREGATE_STATUS] = "others_failed"
else:
log.warn("Others Unknown")
os.environ[BUILD_AGGREGATE_STATUS] = "unknown"
#since python is subprocess, env variables are exported back via file
with open(".to_export_back", "w") as export_var:
export_var.write("BUILD_LEADER=YES {0}={1}".format(BUILD_AGGREGATE_STATUS, os.environ[BUILD_AGGREGATE_STATUS]))
except Exception as e:
log.fatal(e)

View File

@ -1,46 +0,0 @@
#!/bin/bash
# This script prepares build artifacts for upload to NPM.
#
# Usage:
#
# scripts/publish/npm_prepare.sh PACKAGE_NAME
set -ex
shopt -s extglob
NAME=$1
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
cd $ROOT_DIR
NPM_DIR=$ROOT_DIR/dist/npm
FILES='!(test|e2e_test|docs)'
PUBLISH_DIR=$NPM_DIR/$NAME
rm -fr $PUBLISH_DIR
mkdir -p $PUBLISH_DIR
mkdir -p $PUBLISH_DIR/es6/dev
cp -r $ROOT_DIR/dist/js/dev/es6/$NAME/$FILES $PUBLISH_DIR/es6/dev
mkdir -p $PUBLISH_DIR/es6/prod
cp -r $ROOT_DIR/dist/js/prod/es6/$NAME/$FILES $PUBLISH_DIR/es6/prod
mkdir -p $PUBLISH_DIR/ts
cp -r $ROOT_DIR/modules/$NAME/$FILES $PUBLISH_DIR/ts
if [ $NAME = "angular2" ]; then
# Copy Bundles
mkdir -p $PUBLISH_DIR/bundles
cp -r $ROOT_DIR/dist/js/bundle/$FILES $PUBLISH_DIR/bundles
fi
if [ $NAME = "benchpress" ]; then
cp -r $ROOT_DIR/dist/build/benchpress_bundle/$FILES $PUBLISH_DIR
cp -r $ROOT_DIR/dist/js/cjs/benchpress/README.md $PUBLISH_DIR
cp -r $ROOT_DIR/dist/js/cjs/benchpress/LICENSE $PUBLISH_DIR
cp -r $ROOT_DIR/dist/js/cjs/benchpress/docs $PUBLISH_DIR
else
cp -r $ROOT_DIR/dist/js/cjs/$NAME/$FILES $PUBLISH_DIR
fi
# Remove all dart related files
rm -f $PUBLISH_DIR/{,**/}{*.dart,*.dart.md}

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -ex
shopt -s extglob
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
cd $ROOT_DIR
gulp clean
# benchpress.bundle and bundles.js will implicitly build everything we need
# TODO: revert to normal gulp once we fix https://github.com/angular/angular/issues/5229
# gulp benchpress.bundle bundles.js
node --max-old-space-size=1900 ./node_modules/.bin/gulp benchpress.bundle bundles.js
NPM_DIR=$ROOT_DIR/dist/npm
rm -fr $NPM_DIR
scripts/publish/npm_prepare.sh angular2
scripts/publish/npm_prepare.sh benchpress
npm publish $NPM_DIR/angular2
npm publish $NPM_DIR/benchpress
npm logout

View File

@ -1,40 +0,0 @@
#!/bin/bash
set -ex
shopt -s extglob
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
cd ${ROOT_DIR}
gulp clean
node --max-old-space-size=6000 ./node_modules/.bin/gulp build.js buildRouter.dev
NPM_DIR=${ROOT_DIR}/dist/npm
rm -fr ${NPM_DIR}
FILES='!(test|e2e_test|docs)'
DTS_FILES='*.d.ts'
NAME=router
PUBLISH_DIR=${NPM_DIR}/${NAME}
# Clean the publish directory. This is the root directory for npm publish.
rm -fr ${PUBLISH_DIR}
mkdir -p ${PUBLISH_DIR}
# Copy package.json that contains the (scoped) package name and version.
cp ${ROOT_DIR}/modules/angular2/src/router/package.json ${PUBLISH_DIR}
# Create directory for the separate framework versions
mkdir -p ${PUBLISH_DIR}/angular1
mkdir -p ${PUBLISH_DIR}/angular2
# Copy router build artifacts to the publish directory.
cp ${ROOT_DIR}/dist/angular_1_router.js ${PUBLISH_DIR}/angular1/
cp ${ROOT_DIR}/modules/angular1_router/src/ng_route_shim.js ${PUBLISH_DIR}/angular1/
cp ${ROOT_DIR}/dist/js/bundle/router* ${PUBLISH_DIR}/angular2/
# Remove any dart related files
rm -f ${PUBLISH_DIR}/{,**/}{*.dart,*.dart.md}
# Actually publish to npm
npm publish ${PUBLISH_DIR} --tag latest --access public