ci(aio): deploy from CI to staging
This commit is contained in:
parent
c37af2af5a
commit
4165fddfc4
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
|||||||
/dist/
|
/dist/
|
||||||
node_modules
|
node_modules
|
||||||
bower_components
|
bower_components
|
||||||
|
angular.io/dist
|
||||||
|
|
||||||
# Include when developing application packages.
|
# Include when developing application packages.
|
||||||
pubspec.lock
|
pubspec.lock
|
||||||
|
10
.travis.yml
10
.travis.yml
@ -17,15 +17,21 @@ branches:
|
|||||||
- g3_v2_0
|
- g3_v2_0
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
yarn: true
|
||||||
directories:
|
directories:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
- ./.chrome/chromium
|
- ./.chrome/chromium
|
||||||
|
- ./angular.io/node_modules
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# GITHUB_TOKEN_ANGULAR
|
# GITHUB_TOKEN_ANGULAR
|
||||||
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
|
# This is needed for the e2e Travis matrix task to publish packages to github for continuous packages delivery.
|
||||||
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
|
- secure: "fq/U7VDMWO8O8SnAQkdbkoSe2X92PVqg4d044HmRYVmcf6YbO48+xeGJ8yOk0pCBwl3ISO4Q2ot0x546kxfiYBuHkZetlngZxZCtQiFT9kyId8ZKcYdXaIW9OVdw3Gh3tQyUwDucfkVhqcs52D6NZjyE2aWZ4/d1V4kWRO/LMgo="
|
||||||
|
# FIREBASE_TOKEN
|
||||||
|
# This is needed for publishing builds to the "aio-staging" firebase site.
|
||||||
|
# TODO(i): the token was generated using the iminar@google account, we should switch to a shared/role-base account.
|
||||||
|
- secure: "MPx3UM77o5IlhT75PKHL0FXoB5tSXDc3vnCXCd1sRy4XUTZ9vjcV6nNuyqEf+SOw659bGbC1FI4mACGx1Q+z7MQDR85b1mcA9uSgHDkh+IR82CnCVdaX9d1RXafdJIArahxfmorbiiPPLyPIKggo7ituRm+2c+iraoCkE/pXxYg="
|
||||||
matrix:
|
matrix:
|
||||||
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||||
- CI_MODE=e2e EXPERIMENTAL_ES2015_DISTRO=1
|
- CI_MODE=e2e EXPERIMENTAL_ES2015_DISTRO=1
|
||||||
@ -35,6 +41,7 @@ env:
|
|||||||
- CI_MODE=saucelabs_optional
|
- CI_MODE=saucelabs_optional
|
||||||
- CI_MODE=browserstack_optional
|
- CI_MODE=browserstack_optional
|
||||||
- CI_MODE=docs_test
|
- CI_MODE=docs_test
|
||||||
|
- CI_MODE=aio
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
@ -48,5 +55,8 @@ install:
|
|||||||
script:
|
script:
|
||||||
- ./scripts/ci-lite/build.sh && ./scripts/ci-lite/test.sh
|
- ./scripts/ci-lite/build.sh && ./scripts/ci-lite/test.sh
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- ./scripts/ci-lite/deploy_aio_staging.sh
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- ./scripts/ci-lite/cleanup.sh
|
- ./scripts/ci-lite/cleanup.sh
|
||||||
|
5
angular.io/.firebaserc
Normal file
5
angular.io/.firebaserc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"staging": "aio-staging"
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ Run `ng generate component component-name` to generate a new component. You can
|
|||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
|
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
|
||||||
|
|
||||||
## Running unit tests
|
## Running unit tests
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@ describe('site App', function() {
|
|||||||
|
|
||||||
it('should display message saying app works', () => {
|
it('should display message saying app works', () => {
|
||||||
page.navigateTo();
|
page.navigateTo();
|
||||||
expect(page.getParagraphText()).toEqual('app works!');
|
expect(page.getParagraphText()).toEqual('home-page works!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,6 +6,6 @@ export class SitePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getParagraphText() {
|
getParagraphText() {
|
||||||
return element(by.css('app-root h1')).getText();
|
return element(by.css('app-home-page p')).getText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Placeholder for angular.io</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
This page is just a placeholder for angular.io.
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,6 +1,5 @@
|
|||||||
// Karma configuration file, see link for more information
|
// Karma configuration file, see link for more information
|
||||||
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
// https://karma-runner.github.io/0.13/config/configuration-file.html
|
||||||
console.log('karama!!!')
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "angular.io",
|
"name": "angular.io",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"repository": "git@github.com:angular/angular.git",
|
||||||
|
"author": "Angular",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"angular-cli": {},
|
"angular-cli": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
|
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"pree2e": "webdriver-manager update --standalone false --gecko false",
|
"pree2e": "webdriver-manager update --standalone false --gecko false",
|
||||||
"e2e": "protractor"
|
"e2e": "protractor",
|
||||||
|
"deploy-staging": "firebase use staging --token \"$FIREBASE_TOKEN\" && yarn run ~~deploy",
|
||||||
|
"pre~~deploy": "ng build --prod",
|
||||||
|
"~~deploy": "firebase deploy --message \"Commit: $TRAVIS_COMMIT\" --non-interactive --token \"$FIREBASE_TOKEN\""
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -33,6 +40,7 @@
|
|||||||
"@types/node": "^6.0.42",
|
"@types/node": "^6.0.42",
|
||||||
"angular-cli": "1.0.0-beta.26",
|
"angular-cli": "1.0.0-beta.26",
|
||||||
"codelyzer": "~2.0.0-beta.1",
|
"codelyzer": "~2.0.0-beta.1",
|
||||||
|
"firebase-tools": "^3.2.1",
|
||||||
"jasmine-core": "2.5.2",
|
"jasmine-core": "2.5.2",
|
||||||
"jasmine-spec-reporter": "2.5.0",
|
"jasmine-spec-reporter": "2.5.0",
|
||||||
"karma": "1.2.0",
|
"karma": "1.2.0",
|
||||||
|
@ -13,9 +13,9 @@ describe('AppComponent', () => {
|
|||||||
// TestBed.compileComponents();
|
// TestBed.compileComponents();
|
||||||
// });
|
// });
|
||||||
it('should work', () => {
|
it('should work', () => {
|
||||||
expect(true).toBe(true)
|
expect(true).toBe(true);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
// it('should create the app', async(() => {
|
// it('should create the app', async(() => {
|
||||||
// const fixture = TestBed.createComponent(AppComponent);
|
// const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ngio-docs-app',
|
selector: 'app-ngio-docs',
|
||||||
templateUrl: './docs-app.component.html',
|
templateUrl: './docs-app.component.html',
|
||||||
styleUrls: ['./docs-app.component.css']
|
styleUrls: ['./docs-app.component.css']
|
||||||
})
|
})
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { DocsAppComponent } from './docs-app.component'
|
import { DocsAppComponent } from './docs-app.component';
|
||||||
import { RouterModule } from '@angular/router'
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HomePageComponent } from './home-page.component';
|
import { HomePageComponent } from './home-page.component';
|
||||||
import { RouterModule } from '@angular/router'
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -19,4 +19,15 @@ node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/platform-brows
|
|||||||
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/router/tsconfig-build.json
|
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/router/tsconfig-build.json
|
||||||
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/forms/tsconfig-build.json
|
node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/forms/tsconfig-build.json
|
||||||
|
|
||||||
|
if [[ ${CI_MODE} == "aio" ]]; then
|
||||||
|
echo 'travis_fold:start:BUILD.aio'
|
||||||
|
|
||||||
|
# Build angular.io
|
||||||
|
cd "`dirname $0`/../../angular.io"
|
||||||
|
yarn run build
|
||||||
|
cd -
|
||||||
|
|
||||||
|
echo 'travis_fold:end:BUILD.aio'
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'travis_fold:end:BUILD'
|
echo 'travis_fold:end:BUILD'
|
||||||
|
29
scripts/ci-lite/deploy_aio_staging.sh
Executable file
29
scripts/ci-lite/deploy_aio_staging.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex -o pipefail
|
||||||
|
|
||||||
|
# Only deploy if this Travis job is for the upstream master branch
|
||||||
|
if [[ ! ${TRAVIS} || ${CI_MODE} != "aio" || ${TRAVIS_PULL_REQUEST} || ${TRAVIS_BRANCH} != "master" ]]; then
|
||||||
|
echo 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:aio.deploy'
|
||||||
|
|
||||||
|
# Setup environment
|
||||||
|
cd `dirname $0`
|
||||||
|
source ./env.sh
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:aio.deploy.staging'
|
||||||
|
|
||||||
|
# Deploy angular.io to staging
|
||||||
|
cd "`dirname $0`/../../angular.io"
|
||||||
|
yarn run deploy-staging
|
||||||
|
cd -
|
||||||
|
|
||||||
|
echo 'travis_fold:end:aio.deploy.staging'
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:end:aio.deploy'
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
|
|
||||||
|
echo 'travis_fold:start:ENV'
|
||||||
|
|
||||||
NODE_VERSION=5.4.1
|
NODE_VERSION=5.4.1
|
||||||
NPM_VERSION=3.5.3
|
NPM_VERSION=3.5.3
|
||||||
|
YARN_VERSION=0.19.1
|
||||||
CHROMIUM_VERSION=403382 # Chrome 53 linux stable, see https://www.chromium.org/developers/calendar
|
CHROMIUM_VERSION=403382 # Chrome 53 linux stable, see https://www.chromium.org/developers/calendar
|
||||||
SAUCE_CONNECT_VERSION=4.3.11
|
SAUCE_CONNECT_VERSION=4.3.11
|
||||||
|
|
||||||
@ -45,6 +47,9 @@ fi
|
|||||||
|
|
||||||
# GLOBALS
|
# GLOBALS
|
||||||
|
|
||||||
|
# Prepend `~/.yarn/bin` to the PATH
|
||||||
|
export PATH=$HOME/.yarn/bin:$PATH
|
||||||
|
|
||||||
# Append dist/all to the NODE_PATH so that cjs module resolver finds find the packages that use
|
# 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)
|
# absolute module ids (e.g. @angular/core)
|
||||||
export NODE_PATH=${NODE_PATH}:$(pwd)/../../dist/all:$(pwd)/../../dist/tools
|
export NODE_PATH=${NODE_PATH}:$(pwd)/../../dist/all:$(pwd)/../../dist/tools
|
||||||
@ -74,3 +79,4 @@ if [[ ${TRAVIS} ]]; then
|
|||||||
export CHROME_BIN=${HOME}/.chrome/chromium/chrome-linux/chrome
|
export CHROME_BIN=${HOME}/.chrome/chromium/chrome-linux/chrome
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'travis_fold:end:ENV'
|
||||||
|
@ -23,7 +23,7 @@ mkdir -p ${LOGS_DIR}
|
|||||||
# Install version of npm that we are locked against
|
# Install version of npm that we are locked against
|
||||||
echo 'travis_fold:start:install.npm'
|
echo 'travis_fold:start:install.npm'
|
||||||
npm install -g npm@${NPM_VERSION}
|
npm install -g npm@${NPM_VERSION}
|
||||||
echo 'travis_fold:end:install-npm'
|
echo 'travis_fold:end:install.npm'
|
||||||
|
|
||||||
|
|
||||||
# Install all npm dependencies according to shrinkwrap.json
|
# Install all npm dependencies according to shrinkwrap.json
|
||||||
@ -32,12 +32,31 @@ node tools/npm/check-node-modules --purge || npm install
|
|||||||
echo 'travis_fold:end:install.node_modules'
|
echo 'travis_fold:end:install.node_modules'
|
||||||
|
|
||||||
|
|
||||||
|
if [[ ${TRAVIS} && ${CI_MODE} == "aio" ]]; then
|
||||||
|
|
||||||
|
# angular.io: Install version of yarn that we are locked against
|
||||||
|
echo 'travis_fold:start:install.aio.yarn'
|
||||||
|
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "${YARN_VERSION}"
|
||||||
|
echo 'travis_fold:end:install.aio.yarn'
|
||||||
|
|
||||||
|
|
||||||
|
# angular.io: Install all yarn dependencies according to angular.io/yarn.lock
|
||||||
|
echo 'travis_fold:start:install.aio.node_modules'
|
||||||
|
cd "`dirname $0`/../../angular.io"
|
||||||
|
yarn install
|
||||||
|
cd -
|
||||||
|
echo 'travis_fold:end:install.aio.node_modules'
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Install Chromium
|
# Install Chromium
|
||||||
echo 'travis_fold:start:install.chromium'
|
echo 'travis_fold:start:install.chromium'
|
||||||
if [[ ${CI_MODE} == "js" || ${CI_MODE} == "e2e" ]]; then
|
if [[ ${CI_MODE} == "js" || ${CI_MODE} == "e2e" || ${CI_MODE} == "aio" ]]; then
|
||||||
./scripts/ci/install_chromium.sh
|
./scripts/ci/install_chromium.sh
|
||||||
fi
|
fi
|
||||||
echo 'travis_fold:end:install-chromium'
|
echo 'travis_fold:end:install.chromium'
|
||||||
|
|
||||||
|
|
||||||
# Install Sauce Connect
|
# Install Sauce Connect
|
||||||
echo 'travis_fold:start:install.sauceConnect'
|
echo 'travis_fold:start:install.sauceConnect'
|
||||||
|
@ -14,7 +14,6 @@ cd ../..
|
|||||||
./scripts/ci-lite/test_saucelabs.sh
|
./scripts/ci-lite/test_saucelabs.sh
|
||||||
./scripts/ci-lite/test_browserstack.sh
|
./scripts/ci-lite/test_browserstack.sh
|
||||||
./scripts/ci-lite/test_docs.sh
|
./scripts/ci-lite/test_docs.sh
|
||||||
|
./scripts/ci-lite/test_aio.sh
|
||||||
echo 'travis_fold:end:test-browser'
|
|
||||||
|
|
||||||
echo 'travis_fold:end:TEST'
|
echo 'travis_fold:end:TEST'
|
||||||
|
62
scripts/ci-lite/test_aio.sh
Executable file
62
scripts/ci-lite/test_aio.sh
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -ex -o pipefail
|
||||||
|
|
||||||
|
if [[ ${TRAVIS} && ${CI_MODE} != "aio" ]]; then
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:test.aio'
|
||||||
|
|
||||||
|
# Setup environment
|
||||||
|
cd `dirname $0`
|
||||||
|
source ./env.sh
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:test.aio.lint'
|
||||||
|
|
||||||
|
# Lint the code
|
||||||
|
cd "`dirname $0`/../../angular.io"
|
||||||
|
yarn run lint
|
||||||
|
cd -
|
||||||
|
|
||||||
|
echo 'travis_fold:end:test.aio.lint'
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:test.aio.localChromeSetup'
|
||||||
|
|
||||||
|
# Start local Chrome
|
||||||
|
if [[ ${TRAVIS} ]]; then
|
||||||
|
sh -e /etc/init.d/xvfb start
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo 'travis_fold:end:test.aio.localChromeSetup'
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:start:test.aio.unit'
|
||||||
|
|
||||||
|
# Run unit tests
|
||||||
|
cd "`dirname $0`/../../angular.io"
|
||||||
|
yarn test -- --single-run
|
||||||
|
cd -
|
||||||
|
|
||||||
|
echo 'travis_fold:end:test.aio.unit'
|
||||||
|
|
||||||
|
|
||||||
|
# TODO: Chrome crashes with the following error:
|
||||||
|
# E/launcher - unknown error: Chrome failed to start: crashed
|
||||||
|
# (Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.8.12-040812-generic x86_64)
|
||||||
|
# echo 'travis_fold:start:test.aio.e2e'
|
||||||
|
#
|
||||||
|
# # Run e2e tests
|
||||||
|
# cd "`dirname $0`/../../angular.io"
|
||||||
|
# yarn start &
|
||||||
|
# yarn run e2e
|
||||||
|
# cd -
|
||||||
|
#
|
||||||
|
# echo 'travis_fold:end:test.aio.e2e'
|
||||||
|
|
||||||
|
|
||||||
|
echo 'travis_fold:end:test.aio'
|
Loading…
x
Reference in New Issue
Block a user