From 51fe0fe6229668130234d32cea3bc4fb60937484 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 28 Oct 2020 12:23:56 +0200 Subject: [PATCH] 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 --- aio/angular.json | 12 ++++++++++++ aio/src/app/app.component.spec.ts | 1 + aio/src/app/app.component.ts | 1 + aio/src/environments/environment.archive.ts | 4 ++-- aio/src/environments/environment.next.ts | 4 ++-- aio/src/environments/environment.rc.ts | 6 ++++++ aio/src/environments/environment.stable.ts | 4 ++-- aio/src/environments/environment.ts | 6 +++--- aio/src/extra-files/rc/robots.txt | 3 +++ aio/src/styles/2-modules/_deploy-theme.scss | 4 ++++ 10 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 aio/src/environments/environment.rc.ts create mode 100644 aio/src/extra-files/rc/robots.txt diff --git a/aio/angular.json b/aio/angular.json index 6bcb5f287b..b77bf96840 100644 --- a/aio/angular.json +++ b/aio/angular.json @@ -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" }, diff --git a/aio/src/app/app.component.spec.ts b/aio/src/app/app.component.spec.ts index 03ab16fe9f..8e2e860d87 100644 --- a/aio/src/app/app.component.spec.ts +++ b/aio/src/app/app.component.spec.ts @@ -835,6 +835,7 @@ describe('AppComponent', () => { const redirectionPerMode: {[mode: string]: boolean} = { archive: true, next: false, + rc: false, stable: false, }; diff --git a/aio/src/app/app.component.ts b/aio/src/app/app.component.ts index bc07be2930..90a03ae382 100644 --- a/aio/src/app/app.component.ts +++ b/aio/src/app/app.component.ts @@ -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') { diff --git a/aio/src/environments/environment.archive.ts b/aio/src/environments/environment.archive.ts index 5100c50a77..d4ee596cc7 100644 --- a/aio/src/environments/environment.archive.ts +++ b/aio/src/environments/environment.archive.ts @@ -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', }; diff --git a/aio/src/environments/environment.next.ts b/aio/src/environments/environment.next.ts index 63682ea65e..902862c9c5 100644 --- a/aio/src/environments/environment.next.ts +++ b/aio/src/environments/environment.next.ts @@ -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', }; diff --git a/aio/src/environments/environment.rc.ts b/aio/src/environments/environment.rc.ts new file mode 100644 index 0000000000..b88b2a3ef9 --- /dev/null +++ b/aio/src/environments/environment.rc.ts @@ -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', +}; diff --git a/aio/src/environments/environment.stable.ts b/aio/src/environments/environment.stable.ts index f454b83ddc..e75c13393c 100644 --- a/aio/src/environments/environment.stable.ts +++ b/aio/src/environments/environment.stable.ts @@ -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', }; diff --git a/aio/src/environments/environment.ts b/aio/src/environments/environment.ts index 21ed7b8989..c56434e8a6 100644 --- a/aio/src/environments/environment.ts +++ b/aio/src/environments/environment.ts @@ -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=` then `environment..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', }; diff --git a/aio/src/extra-files/rc/robots.txt b/aio/src/extra-files/rc/robots.txt new file mode 100644 index 0000000000..35272cac72 --- /dev/null +++ b/aio/src/extra-files/rc/robots.txt @@ -0,0 +1,3 @@ +# Disallow all URLs (see http://www.robotstxt.org/robotstxt.html) +User-agent: * +Disallow: / diff --git a/aio/src/styles/2-modules/_deploy-theme.scss b/aio/src/styles/2-modules/_deploy-theme.scss index 8a09afb3f0..89ddd3cb00 100644 --- a/aio/src/styles/2-modules/_deploy-theme.scss +++ b/aio/src/styles/2-modules/_deploy-theme.scss @@ -5,3 +5,7 @@ aio-shell.mode-archive { aio-shell.mode-next { @include deployTheme(#DD0031, #C3002F); } + +aio-shell.mode-rc { + @include deployTheme(#DDA302, #C3A300); +}