repackaging: all the repackaging changes squashed
This commit is contained in:
17
scripts/ci-lite/build.sh
Executable file
17
scripts/ci-lite/build.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
echo 'travis_fold:start:BUILD'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
$(npm bin)/tsc -p ./tools/tsconfig.json
|
||||
$(npm bin)/tsc -p ./modules/tsconfig.json
|
||||
|
||||
|
||||
|
||||
echo 'travis_fold:end:BUILD'
|
33
scripts/ci-lite/cleanup.sh
Executable file
33
scripts/ci-lite/cleanup.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
echo 'travis_fold:start:CLEANUP'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
|
||||
case ${CI_MODE} in
|
||||
js)
|
||||
;;
|
||||
saucelabs_required)
|
||||
./scripts/sauce/sauce_connect_teardown.sh
|
||||
;;
|
||||
browserstack_required)
|
||||
./scripts/browserstack/teardown_tunnel.sh
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:cleanup.printLogs'
|
||||
./scripts/ci/print-logs.sh
|
||||
echo 'travis_fold:end:cleanup.printLogs'
|
||||
|
||||
|
||||
echo 'travis_fold:end:CLEANUP'
|
62
scripts/ci-lite/env.sh
Normal file
62
scripts/ci-lite/env.sh
Normal file
@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
|
||||
NODE_VERSION=5.4.1
|
||||
NPM_VERSION=3.5.3
|
||||
CHROMIUM_VERSION=386251 # Chrome 50 linux stable, see https://www.chromium.org/developers/calendar
|
||||
SAUCE_CONNECT_VERSION=4.3.11
|
||||
|
||||
|
||||
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
# Token for tsd to increase github rate limit
|
||||
# See https://github.com/DefinitelyTyped/tsd#tsdrc
|
||||
# This does not use http://docs.travis-ci.com/user/environment-variables/#Secure-Variables
|
||||
# because those are not visible for pull requests, and those should also be reliable.
|
||||
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
|
||||
# (password is in Valentine)
|
||||
TSDRC='{"token":"ef474500309daea53d5991b3079159a29520a40b"}'
|
||||
|
||||
|
||||
case ${CI_MODE} in
|
||||
js)
|
||||
KARMA_JS_BROWSERS=ChromeNoSandbox
|
||||
;;
|
||||
saucelabs_required)
|
||||
KARMA_JS_BROWSERS=`node -e "console.log(require('/home/travis/build/angular/angular/browser-providers.conf').sauceAliases.CI_REQUIRED.join(','))"`
|
||||
;;
|
||||
browserstack_required)
|
||||
KARMA_JS_BROWSERS=`node -e "console.log(require('/home/travis/build/angular/angular/browser-providers.conf').browserstackAliases.CI_REQUIRED.join(','))"`
|
||||
;;
|
||||
esac
|
||||
else
|
||||
KARMA_JS_BROWSERS=Chrome
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# GLOBALS
|
||||
|
||||
# Append dist/all to the NODE_PATH so that cjs module resolver finds find the packages that use
|
||||
# absolute module ids (e.g. @angular/core)
|
||||
export NODE_PATH=${NODE_PATH}:$(pwd)/../../dist/all
|
||||
export LOGS_DIR=/tmp/angular-build/logs
|
||||
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
# used by xvfb that is used by Chromium
|
||||
export DISPLAY=:99.0
|
||||
|
||||
# Use newer verison of GCC to that is required to compile native npm modules for Node v4+ on Ubuntu Precise
|
||||
# more info: https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements
|
||||
export CXX=g++-4.8
|
||||
|
||||
# Used by karma and karma-chrome-launcher
|
||||
export SAUCE_USERNAME=angular-ci
|
||||
export SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
|
||||
export BROWSER_STACK_USERNAME=angularteam1
|
||||
export BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
|
||||
export CHROME_BIN=${HOME}/.chrome/chromium/chrome-linux/chrome
|
||||
fi
|
||||
|
84
scripts/ci-lite/install.sh
Executable file
84
scripts/ci-lite/install.sh
Executable file
@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
echo 'travis_fold:start:INSTALL'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
mkdir -p ${LOGS_DIR}
|
||||
|
||||
|
||||
# TODO: install nvm?? it's already on travis so we don't need it
|
||||
#curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
|
||||
|
||||
|
||||
# Install node
|
||||
#nvm install ${NODE_VERSION}
|
||||
|
||||
|
||||
# Install version of npm that we are locked against
|
||||
echo 'travis_fold:start:install.npm'
|
||||
npm install -g npm@${NPM_VERSION}
|
||||
echo 'travis_fold:end:install-npm'
|
||||
|
||||
|
||||
# Install all npm dependencies according to shrinkwrap.json
|
||||
# note: package.json contain preinstall and postintall hooks that can short-circuit
|
||||
# the installation if node_modules is up to date
|
||||
echo 'travis_fold:start:install.node_modules'
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
node tools/npm/check-node-modules --purge
|
||||
fi
|
||||
npm install
|
||||
echo 'travis_fold:end:install.node_modules'
|
||||
|
||||
|
||||
# Install Chromium
|
||||
echo 'travis_fold:start:install.chromium'
|
||||
if [[ ${TRAVIS} && ${CI_MODE} == "js" ]]; then
|
||||
./scripts/ci/install_chromium.sh
|
||||
fi
|
||||
echo 'travis_fold:end:install-chromium'
|
||||
|
||||
# Install Sauce Connect
|
||||
echo 'travis_fold:start:install.sauceConnect'
|
||||
if [[ ${TRAVIS} && ${CI_MODE} == "saucelabs_required" ]]; then
|
||||
./scripts/sauce/sauce_connect_setup.sh
|
||||
fi
|
||||
echo 'travis_fold:end:install.sauceConnect'
|
||||
|
||||
|
||||
# Install BrowserStack Tunnel
|
||||
echo 'travis_fold:start:install.browserstack'
|
||||
if [[ ${TRAVIS} && ${CI_MODE} == "browserstack_required" ]]; then
|
||||
./scripts/browserstack/start_tunnel.sh
|
||||
fi
|
||||
echo 'travis_fold:end:install.browserstack'
|
||||
|
||||
|
||||
# Install external typings via tsd
|
||||
echo 'travis_fold:start:install.typings'
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
echo ${TSDRC} > ~/.tsdrc
|
||||
fi
|
||||
|
||||
$(npm bin)/tsd reinstall --overwrite --clean --config modules/@angular/tsd.json
|
||||
$(npm bin)/tsd reinstall --overwrite --clean --config tools/tsd.json
|
||||
$(npm bin)/tsd reinstall --overwrite --config modules/angular1_router/tsd.json
|
||||
echo 'travis_fold:end:install.typings'
|
||||
|
||||
|
||||
# TODO: install webdriver stuff
|
||||
# node tools/chromedriverpatch.js
|
||||
# webdriver-manager update
|
||||
|
||||
# TODO: install bower packages
|
||||
# bower install
|
||||
|
||||
# TODO: install dart packages
|
||||
|
||||
echo 'travis_fold:end:INSTALL'
|
19
scripts/ci-lite/test.sh
Executable file
19
scripts/ci-lite/test.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
echo 'travis_fold:start:TEST'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
./scripts/ci-lite/test_js.sh
|
||||
./scripts/ci-lite/test_build_only.sh
|
||||
./scripts/ci-lite/test_saucelabs.sh
|
||||
./scripts/ci-lite/test_browserstack.sh
|
||||
|
||||
echo 'travis_fold:end:test-browser'
|
||||
|
||||
echo 'travis_fold:end:TEST'
|
22
scripts/ci-lite/test_browserstack.sh
Executable file
22
scripts/ci-lite/test_browserstack.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
if [[ ${TRAVIS} && ${CI_MODE} != "browserstack_required" ]]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:test_browserstack'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
|
||||
./scripts/browserstack/waitfor_tunnel.sh
|
||||
export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev`
|
||||
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
||||
|
||||
echo 'travis_fold:end:test_browserstack'
|
25
scripts/ci-lite/test_build_only.sh
Executable file
25
scripts/ci-lite/test_build_only.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
if [[ ${TRAVIS} && ${CI_MODE} != "build_only" ]]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:test.js'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
|
||||
echo 'travis_fold:start:test.buildPackages'
|
||||
|
||||
./build.sh
|
||||
|
||||
echo 'travis_fold:end:test.buildPackages'
|
||||
|
||||
|
||||
echo 'travis_fold:end:test.js'
|
42
scripts/ci-lite/test_js.sh
Executable file
42
scripts/ci-lite/test_js.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
if [[ ${TRAVIS} && ${CI_MODE} != "js" ]]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:test.js'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
|
||||
echo 'travis_fold:start:test.node'
|
||||
|
||||
# Run unit tests in node
|
||||
node ./dist/tools/tsc-watch/ node
|
||||
|
||||
echo 'travis_fold:end:test.node'
|
||||
|
||||
|
||||
|
||||
echo 'travis_fold:start:test.localChrome'
|
||||
|
||||
# rebuild since codegen has overwritten some files.
|
||||
$(npm bin)/tsc -p modules/tsconfig.json
|
||||
|
||||
# Run unit tests in local chrome
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
sh -e /etc/init.d/xvfb start
|
||||
fi
|
||||
|
||||
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
||||
echo 'travis_fold:end:test.localChrome'
|
||||
|
||||
|
||||
|
||||
echo 'travis_fold:end:test.js'
|
22
scripts/ci-lite/test_saucelabs.sh
Executable file
22
scripts/ci-lite/test_saucelabs.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
if [[ ${TRAVIS} && ${CI_MODE} != "saucelabs_required" ]]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:test_saucelabs'
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
|
||||
./scripts/sauce/sauce_connect_block.sh
|
||||
SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
|
||||
$(npm bin)/karma start ./karma-js.conf.js --single-run --browsers=${KARMA_JS_BROWSERS}
|
||||
|
||||
echo 'travis_fold:end:test_saucelabs'
|
@ -2,6 +2,11 @@
|
||||
|
||||
set -e -x
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ../ci-lite/env.sh
|
||||
|
||||
|
||||
# This script basically follows the instructions to download an old version of Chromium: https://www.chromium.org/getting-involved/download-chromium
|
||||
# 1) It retrieves the current stable version number from https://www.chromium.org/developers/calendar (via the https://omahaproxy.appspot.com/all file), e.g. 359700 for Chromium 48.
|
||||
# 2) It checks the Travis cache for this specific version
|
||||
@ -9,7 +14,8 @@ set -e -x
|
||||
|
||||
#Build version read from the OmahaProxy CSV Viewer at https://www.chromium.org/developers/calendar
|
||||
#Let's use the following version of Chromium, and inform about availability of newer build from https://omahaproxy.appspot.com/all
|
||||
CHROMIUM_VERSION=369907
|
||||
#
|
||||
# CHROMIUM_VERSION <<< this variable is now set via env.sh
|
||||
|
||||
PLATFORM="$(uname -s)"
|
||||
case "$PLATFORM" in
|
||||
|
@ -3,9 +3,12 @@
|
||||
LOG_FILES=$LOGS_DIR/*
|
||||
|
||||
for FILE in $LOG_FILES; do
|
||||
|
||||
echo -e "\n\n\n"
|
||||
echo "================================================================================"
|
||||
echo 'travis_fold:start:cleanup.printfile'
|
||||
echo " $FILE"
|
||||
echo "================================================================================"
|
||||
cat $FILE
|
||||
done
|
||||
echo 'travis_fold:end:cleanup.printfile'
|
||||
done
|
||||
|
@ -2,6 +2,12 @@
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
# Setup environment
|
||||
cd `dirname $0`
|
||||
source ../ci-lite/env.sh
|
||||
|
||||
|
||||
|
||||
# Setup and start Sauce Connect for your TravisCI build
|
||||
# This script requires your .travis.yml to include the following two private env variables:
|
||||
# SAUCE_USERNAME
|
||||
@ -12,7 +18,7 @@ set -e -o pipefail
|
||||
# before_script:
|
||||
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
|
||||
|
||||
CONNECT_URL="https://saucelabs.com/downloads/sc-4.3.11-linux.tar.gz"
|
||||
CONNECT_URL="https://saucelabs.com/downloads/sc-${SAUCE_CONNECT_VERSION}-linux.tar.gz"
|
||||
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
|
||||
CONNECT_DOWNLOAD="sc-latest-linux.tar.gz"
|
||||
|
||||
|
Reference in New Issue
Block a user