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

Commit b4b451a

Browse files
committed
chore(ci): fix deploy-code CI job
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
1 parent 83f084e commit b4b451a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ executors:
3535
description: The docker container to use when running gcp-gcs commands
3636
docker:
3737
- image: google/cloud-sdk:alpine@sha256:7d0cae28cb282b76f2d9babe278c63c910d54f0cceca7a65fdf6806e2b43882e
38+
working_directory: ~/ng
3839

3940

4041
# Filter Definitions
@@ -157,7 +158,6 @@ commands:
157158
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
158159
git config --global url."ssh://[email protected]".insteadOf "https://github.com" || true
159160
git config --global gc.auto 0 || true
160-
- install_java
161161
162162
init_saucelabs_environment:
163163
description: Sets up a domain that resolves to the local host.
@@ -231,6 +231,7 @@ jobs:
231231
steps:
232232
- checkout
233233
- init_environment
234+
- install_java
234235
- run:
235236
name: Running Yarn install
236237
command: yarn install --frozen-lockfile --non-interactive
@@ -259,6 +260,7 @@ jobs:
259260
steps:
260261
- custom_attach_workspace
261262
- init_environment
263+
- install_java
262264
- init_saucelabs_environment
263265
- run: yarn grunt test:promises-aplus
264266
- run:
@@ -358,7 +360,7 @@ jobs:
358360
- custom_attach_workspace
359361
- init_environment
360362
- skip_unless_tag_or_master_or_stable_branch
361-
- run: ls ~/ng/deploy/code
363+
- run: ls deploy/code
362364
- run:
363365
name: Authenticate and configure Docker
364366
command: |
@@ -367,7 +369,7 @@ jobs:
367369
- run:
368370
name: Sync files to code.angularjs.org
369371
command: |
370-
gsutil -m rsync -r ~/ng/deploy/code gs://code-angularjs-org-338b8.appspot.com
372+
gsutil -m rsync -r deploy/code gs://code-angularjs-org-338b8.appspot.com
371373
372374
# The `deploy-docs` job should only run when all of these conditions are true for the build:
373375
# - It is for the `angular/angular.js` repository (not a fork).

0 commit comments

Comments
 (0)