Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(ci): fix code/docs deployment #17063

Closed
wants to merge 3 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Aug 20, 2020

This PR includes various fixes related to deployment (i.e. the prepare-deployment, deploy-code and deploy-docs CircleCI jobs). See individual commits for details.

You can see the deploy-code and deploy-docs jobs successfully (dry-)running here, which is based on test commit f2e7266.

@gkalpak gkalpak force-pushed the chore-ci-fix-deployment branch 3 times, most recently from 2a945d5 to 111aede Compare August 20, 2020 11:18
@gkalpak gkalpak mentioned this pull request Aug 20, 2020
4 tasks
@gkalpak gkalpak force-pushed the chore-ci-fix-deployment branch 4 times, most recently from 14be6f0 to 84130db Compare August 20, 2020 14:38
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.
Previously, the `prepare-deployment` CI job, which requires all unit and
e2e test jobs to have succeeded before running, was ignoring the `lint`
job. As a result, deployments might happen even when there were linting
issues. This looks like an oversight.

This commit ensures that, in addition to unit and e2e tests passing,
linting must also pass before deploying the code or documentation.
@gkalpak gkalpak force-pushed the chore-ci-fix-deployment branch 2 times, most recently from f2e7266 to 6b12fa3 Compare August 20, 2020 16:51
@gkalpak gkalpak marked this pull request as ready for review August 20, 2020 17:09
@gkalpak gkalpak changed the title chore(ci): fix deployment chore(ci): fix code/docs deployment Aug 20, 2020
@gkalpak gkalpak closed this in a6a6c16 Aug 21, 2020
gkalpak added a commit that referenced this pull request Aug 21, 2020
Previously, the `prepare-deployment` CI job, which requires all unit and
e2e test jobs to have succeeded before running, was ignoring the `lint`
job. As a result, deployments might happen even when there were linting
issues. This looks like an oversight.

This commit ensures that, in addition to unit and e2e tests passing,
linting must also pass before deploying the code or documentation.

Closes #17063
@gkalpak gkalpak deleted the chore-ci-fix-deployment branch August 21, 2020 14:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants