Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: combine "define_env_vars" and "download_yarn" anchor #28788

Closed

Conversation

devversion
Copy link
Member

As discussed in #28546 (comment), we want to combine the define_env_vars and
download_yarn anchor since downloading Yarn depends on setting up the environment
variables. In addition this simplifies our setup and reduces code-duplication.

@devversion devversion requested a review from a team as a code owner February 17, 2019 17:45
@devversion devversion force-pushed the ci/cleanup-circleci-config branch 3 times, most recently from d4399da to cd147ea Compare February 17, 2019 18:09
@devversion devversion added area: build & ci Related the build and CI infrastructure of the project target: patch This PR is targeted for the next patch release labels Feb 17, 2019
@ngbot ngbot bot added this to the needsTriage milestone Feb 17, 2019
@devversion devversion added the action: review The PR is still awaiting reviews from at least one requested reviewer label Feb 17, 2019
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The &download_yarn anchor is no longer needed and should be removed.

command: ./.circleci/env.sh
name: Initializing environment (setting up variables, downloading Yarn)
command: |
source ./.circleci/env.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to source it now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because we need the yarn version variable available in the current bash shell. The command after the env.sh script depends on it.

Not sure if we want to add a comment for this. Should be quite clear IMO 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that PROFILE=$BASH_ENV was sufficient. Fair enough then 😏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 Yeah that PROFILE variable is just used by the Yarn install script to update the $PATH.

Copy link
Contributor

@alexeagle alexeagle Feb 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've gone back and forth between installing tooling during the run (slower) or building the right environment into the docker image (more maintenance)
I feel like the latter is the more principled thing but maybe not practical, up to you

With more work, we ought to be able to have both:

  • change the Dockerfile, the CI picks that up and builds a new docker image for this build
  • don't need to do any environment setup on each execution

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm personally a bigger fan of preparing a proper docker image. We should have a discussion about this in a follow-up as this should be something we need to figure out long-term.

As discussed in angular#28546 (comment), we want to combine the
`define_env_vars` and `download_yarn` anchor since downloading Yarn depends on setting up the
environment variables. In addition this simplifies our setup and reduces code-duplication.
@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 18, 2019
IgorMinar pushed a commit that referenced this pull request Feb 19, 2019
As discussed in #28546 (comment), we want to combine the
`define_env_vars` and `download_yarn` anchor since downloading Yarn depends on setting up the
environment variables. In addition this simplifies our setup and reduces code-duplication.

PR Close #28788
@IgorMinar IgorMinar closed this in 00a8b07 Feb 19, 2019
@devversion devversion deleted the ci/cleanup-circleci-config branch February 19, 2019 21:28
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants