build(docs-infra): add new angular.io build configuration for release-candidates (#39470)

This commit adds a new build configuration/deployment mode (`rc`) for
deploying release-candidate versions to angular.io.

This is part of the work needed to prepare angular.io for our
[new versioning/branching process][1] (also tracked in #39366).

[1]: https://docs.google.com/document/d/197kVillDwx-RZtSVOBtPb4BBIAw0E9RT3q3v6DZkykU

PR Close #39470
This commit is contained in:
George Kalpakas 2020-10-28 12:23:56 +02:00 committed by Joey Perrott
parent 0f584694cc
commit 51fe0fe622
10 changed files with 36 additions and 9 deletions

View File

@ -81,6 +81,15 @@
],
"serviceWorker": true
},
"rc": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.rc.ts"
}
],
"serviceWorker": true
},
"stable": {
"fileReplacements": [
{
@ -116,6 +125,9 @@
"next": {
"browserTarget": "site:build:next"
},
"rc": {
"browserTarget": "site:build:rc"
},
"stable": {
"browserTarget": "site:build:stable"
},

View File

@ -835,6 +835,7 @@ describe('AppComponent', () => {
const redirectionPerMode: {[mode: string]: boolean} = {
archive: true,
next: false,
rc: false,
stable: false,
};

View File

@ -152,6 +152,7 @@ export class AppComponent implements OnInit {
// TODO(pbd): consider whether we can lookup the stable and next versions from the internet
const computedVersions: NavigationNode[] = [
{ title: 'next', url: 'https://next.angular.io/' },
{ title: 'rc', url: 'https://rc.angular.io/' },
{ title: 'stable', url: 'https://angular.io/' },
];
if (this.deployment.mode === 'archive') {

View File

@ -1,6 +1,6 @@
// This is for archived sites, which are hosted at https://vX.angular.io, where X is the major Angular version.
// This is for archived sites, which are hosted at https://vX.angular.io/, where X is the major Angular version.
export const environment = {
gaId: 'UA-8594346-15', // Production id (since it is linked from the main site)
production: true,
mode: 'archive'
mode: 'archive',
};

View File

@ -1,6 +1,6 @@
// This is for the staging site, which is hosted at https://next.angular.io (and https://aio-staging.firebaseapp.org)
// This is for the staging site, which is hosted at https://next.angular.io/.
export const environment = {
gaId: 'UA-8594346-15', // Production id (since it is linked from the main site)
production: true,
mode: 'next'
mode: 'next',
};

View File

@ -0,0 +1,6 @@
// This is for the release-candidate site, which is hosted at https://rc.angular.io/.
export const environment = {
gaId: 'UA-8594346-15', // Production id (since it is linked from the main site)
production: true,
mode: 'rc',
};

View File

@ -1,6 +1,6 @@
// This is for the production site, which is hosted at https://angular.io
// This is for the production site, which is hosted at https://angular.io/.
export const environment = {
gaId: 'UA-8594346-15', // Production id
production: true,
mode: 'stable'
mode: 'stable',
};

View File

@ -1,11 +1,11 @@
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `angular-cli.json`.
// `ng build --configuration=<foo>` then `environment.<foo>.ts` will be used instead.
// The list of which configurations maps to which file can be found in `angular.json`.
export const environment = {
gaId: 'UA-8594346-26', // Development id
production: false,
mode: 'stable'
mode: 'stable',
};

View File

@ -0,0 +1,3 @@
# Disallow all URLs (see http://www.robotstxt.org/robotstxt.html)
User-agent: *
Disallow: /

View File

@ -5,3 +5,7 @@ aio-shell.mode-archive {
aio-shell.mode-next {
@include deployTheme(#DD0031, #C3002F);
}
aio-shell.mode-rc {
@include deployTheme(#DDA302, #C3A300);
}