-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(ci): correctly deploy code and docs on version branches and tags #17060
Conversation
As mentioned in `RELEASE.md`, now that the [CDN][1] has been updated with the 1.8.0 version, it is safe to bump the value of the `branchVersion` property in `package.json` to `^1.8.0`. This will cause the docs app to use the latest version, namely 1.8.0. [1]: https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/angular.js
ec2e14b
to
619ad1a
Compare
619ad1a
to
7f673e1
Compare
7f673e1
to
7b8da86
Compare
Previously, the generated build artifacts and docs were only deployed for builds associated with the master branch. There was also a `latest` branch mentioned in the config, but there is normally no such branch, so this had no effect. This commit fixes the rules so that deployments happen when necessary. More specifically: - The `deploy-code` job now runs for builds associated with: - The master branch. - The stable branch (i.e. the branch from which the version tagged as `@latest` on npm is released). - Tags of the form `v1.X.Y(-Z)`. (This also required configuring CircleCI to run builds for git tags, which does not happen by default.) - The `deploy-docs` job now runs for builds associated with: - The stable branch (i.e. the branch from which the version tagged as `@latest` on npm is released). The new rules for when deployments should take place are based on the logic previously in [.travis.yml][1] and [scripts/travis/build.sh][2] (from before we switched from Travis to CircleCI). [1]: https://github.com/angular/angular.js/blob/974700af7c1/.travis.yml#L54-L103 [2]: https://github.com/angular/angular.js/blob/974700af7c1/scripts/travis/build.sh#L66-L101
7b8da86
to
670656d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@gkalpak Thanks much for doing this work for the old framework that is Angular1.x. |
@g-patel most like we'll need @petebacondarwin to review this and approve it as well. FYI: the AngularJS LTS blog post was updated to include the Covid-19 extension of the LTS. |
Thanks for reply @Splaktar. Good to know that the blog post has been updated. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor question - otherwise LGTM
.circleci/config.yml
Outdated
- custom_attach_workspace | ||
- init_environment | ||
- skip_unless_stable_branch | ||
- run: yarn grunt prepareDeploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed since the deploy-docs
job requires the prepare-deployment
job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is still necessary, because we are not persisting all affected files to the workspace.
Currently, the prepareDeploy
command will affect files in the deploy/
and scripts/docs.angularjs.org-firebase/
directories and also create a firebase.json
file at the root directory, but we only persist the deploy/
directory.
I guess we could persist the whole ng/
directory and not require this, though. I'll update the PR.
016a3d2
to
8abac0d
Compare
…oy-docs` CI job Previously, the `grunt prepareDeploy` command was run in both the `prepare-deployment` and `deploy-docs` CI jobs. The reason was that not all files affected by `grunt prepareDeploy` were persisted to the workspace across jobs. More specifically, the command would affect files in the `deploy/` and `scripts/docs.angularjs.org-firebase/` directories and also create a `firebase.json` file at the root directory, but only the `deploy/` directory was [persisted to the workspace][1]. This commit avoids unnecessarily running the `grunt prepareDeploy` command in the `deploy-docs` CI job by ensuring that all affected files will be persisted to the workspace in the `prepare-deployment` CI job, which always runs before `deploy-docs`. [1]: https://github.com/angular/angular.js/blob/295213df953766625462/.circleci/config.yml#L265
8abac0d
to
7650afc
Compare
…oy-docs` CI job Previously, the `grunt prepareDeploy` command was run in both the `prepare-deployment` and `deploy-docs` CI jobs. The reason was that not all files affected by `grunt prepareDeploy` were persisted to the workspace across jobs. More specifically, the command would affect files in the `deploy/` and `scripts/docs.angularjs.org-firebase/` directories and also create a `firebase.json` file at the root directory, but only the `deploy/` directory was [persisted to the workspace][1]. This commit avoids unnecessarily running the `grunt prepareDeploy` command in the `deploy-docs` CI job by ensuring that all affected files will be persisted to the workspace in the `prepare-deployment` CI job, which always runs before `deploy-docs`. [1]: https://github.com/angular/angular.js/blob/295213df953766625462/.circleci/config.yml#L265 Closes #17060
In angular#17060, the `deploy-code` job was updated to [include][1] the `init_environment` step. This step assumes that the working directory is `~/ng`. The `deploy-code` job uses the `cloud-sdk`, which [did not specify a working directory][2]. As a result, the `init_environment` step and subsequently the `deploy-code` job failed. Examples failures: [on master][3], [on v1.8.x][4] This commit fixes the issue by specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5302fa77924e1fb1f3239/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5302fa77924e1fb1f3239/.circleci/config.yml#L34-L37 [3]: https://app.circleci.com/pipelines/github/angular/angular.js/152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 [4]: https://app.circleci.com/pipelines/github/angular/angular.js/153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. angular#17060 configured the job to run as necessary, which brought up the error. Example failure: [on v1.8.x][1] This commit fixes the typo in the command. [1]: https://app.circleci.com/pipelines/github/angular/angular.js/153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606
In angular#17060, the `deploy-code` job was updated to [include][1] the `init_environment` step. This step assumes that the working directory is ng`~/ng`. The `deploy-code` job uses the `cloud-sdk`, which [did not specify a working directory][2]. As a result, the `init_environment` step and subsequently the `deploy-code` job failed. Examples failures: - On master: https://app.circleci.com/pipelines/github/angular/angular.js/ 152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607 This commit fixes the issue by specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. angular#17060 configured the job to run as necessary, which brought up the error. Example failure: - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606 This commit fixes the typo in the command.
In angular#17060, the `deploy-code` job was updated to [include][1] the `init_environment` custom command. This caused the job to start failing, because the `init_environment` command was not compatible with the `cloud-sdk` executor used in `deploy-code`. There were two problems: 1. The `init_environment` command assumes that the working directory is `~/ng`. The `cloud-sdk` executor [did not specify][2] a working directory. Example failures: - On master: https://app.circleci.com/pipelines/github/angular/angular.js/ 152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607 2. The `install_java` step, which is part of the `init_environment` command, relies on `sudo`, which is not available in the `cloud-sdk` executor. Example failure: - [On a PR]: https://app.circleci.com/pipelines/github/angular/angular.js/ 160/workflows/2eed5cfa-751c-44ba-b825-1d6cd5ba3406/jobs/1660 This commit fixes the issues by: 1. Specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. 2. Removing the `install_java` step from the `init_environment` command and adding it explicitly to jobs than require it. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. angular#17060 configured the job to run as necessary, which brought up the error. Example failure: - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606 This commit fixes the typo in the command.
In angular#17060, the `deploy-code` job was updated to [include][1] the `init_environment` custom command. This caused the job to start failing, because the `init_environment` command was not compatible with the `cloud-sdk` executor used in `deploy-code`. There were two problems: 1. The `init_environment` command assumes that the working directory is `~/ng`. The `cloud-sdk` executor [did not specify][2] a working directory. Example failures: - On master: https://app.circleci.com/pipelines/github/angular/angular.js/ 152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607 2. The `install_java` step, which is part of the `init_environment` command, relies on `sudo`, which is not available in the `cloud-sdk` executor. Example failure: - [On a PR]: https://app.circleci.com/pipelines/github/angular/angular.js/ 160/workflows/2eed5cfa-751c-44ba-b825-1d6cd5ba3406/jobs/1660 This commit fixes the issues by: 1. Specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. 2. Removing the `install_java` step from the `init_environment` command and adding it explicitly to jobs than require it. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. angular#17060 configured the job to run as necessary, which brought up the error. Example failure: - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606 This commit fixes the typo in the command.
In #17060, the `deploy-code` job was updated to [include][1] the `init_environment` custom command. This caused the job to start failing, because the `init_environment` command was not compatible with the `cloud-sdk` executor used in `deploy-code`. There were two problems: 1. The `init_environment` command assumes that the working directory is `~/ng`. The `cloud-sdk` executor [did not specify][2] a working directory. Example failures: - On master: https://app.circleci.com/pipelines/github/angular/angular.js/ 152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607 2. The `install_java` step, which is part of the `init_environment` command, relies on `sudo`, which is not available in the `cloud-sdk` executor. Example failure: - [On a PR]: https://app.circleci.com/pipelines/github/angular/angular.js/ 160/workflows/2eed5cfa-751c-44ba-b825-1d6cd5ba3406/jobs/1660 This commit fixes the issues by: 1. Specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. 2. Removing the `install_java` step from the `init_environment` command and adding it explicitly to jobs than require it. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. #17060 configured the job to run as necessary, which brought up the error. Example failure: - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606 This commit fixes the typo in the command.
In #17060, the `deploy-code` job was updated to [include][1] the `init_environment` custom command. This caused the job to start failing, because the `init_environment` command was not compatible with the `cloud-sdk` executor used in `deploy-code`. There were two problems: 1. The `init_environment` command assumes that the working directory is `~/ng`. The `cloud-sdk` executor [did not specify][2] a working directory. Example failures: - On master: https://app.circleci.com/pipelines/github/angular/angular.js/ 152/workflows/812df7b2-4bba-4e9e-a868-8c58db5d40d1/jobs/1594 - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1607 2. The `install_java` step, which is part of the `init_environment` command, relies on `sudo`, which is not available in the `cloud-sdk` executor. Example failure: - [On a PR]: https://app.circleci.com/pipelines/github/angular/angular.js/ 160/workflows/2eed5cfa-751c-44ba-b825-1d6cd5ba3406/jobs/1660 This commit fixes the issues by: 1. Specifying a working directory for the `cloud-sdk` executor. It also updates paths used in other steps of the `deploy-code` job to take the working directory into account. 2. Removing the `install_java` step from the `init_environment` command and adding it explicitly to jobs than require it. [1]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L359 [2]: https://github.com/angular/angular.js/blob/83f084e5db95768dcee5/.circleci/config.yml#L34-L37
One step in the `deploy-docs` CI job contains a typo that causes it to fail: `yarn -cwd ...` instead of `yarn --cwd ...` This has been broken since a0488b3, but has not been noticed because the job was not running. #17060 configured the job to run as necessary, which brought up the error. Example failure: - On v1.8.x: https://app.circleci.com/pipelines/github/angular/angular.js/ 153/workflows/6a9826ac-d191-4042-8c39-0c969c81e381/jobs/1606 This commit fixes the typo in the command.
Previously, the generated build artifacts and docs were only deployed for builds associated with the master branch. There was also a
latest
branch mentioned in the config, but there is normally no such branch, so this had no effect.This commit fixes the rules so that deployments happen when necessary.
More specifically:
deploy-code
job now runs for builds associated with:@latest
on npm is released).v1.X.Y(-Z)
. (This also required configuring CircleCI to run builds for git tags, which does not happen by default.)deploy-docs
job now runs for builds associated with:@latest
on npm is released).The new rules for when deployments should take place are based on the logic previously in .travis.yml and scripts/travis/build.sh (from before we switched from Travis to CircleCI).