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

chore: remove packaging prerequisites requirements from build #11691

Merged
merged 4 commits into from
Dec 3, 2020

Conversation

NetaNir
Copy link
Contributor

@NetaNir NetaNir commented Nov 25, 2020

Split the prerequisites check for pack and build. Executing build does not execute pack, which means it does not require the tools for packaging (mvn, python, .Net, java) to be installed locally.

This PR splits check-prerequisites into two separate scripts, check-build-prerequisites and check-pack-prerequisites.

For build check:

  • node
  • yarn
  • docker (arguable, but fine)

For pack check:

  • all build prerequisites
  • mvn
  • java
  • .Net
  • python

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Nov 25, 2020

@NetaNir NetaNir requested review from ericzbeard, rix0rrr and a team November 25, 2020 04:02
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 25, 2020
@mergify
Copy link
Contributor

mergify bot commented Nov 25, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@nija-at nija-at added the pr/do-not-merge This PR should not be merged at this time. label Nov 25, 2020
Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

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

How about instead changing check-prerequisites to take a parameter instead, say 'stage'?
This can be set to 'build' or 'pack'.

This way if a pre-requisite is needed for multiple stages, we can avoid duplicating this across multiple scripts. And keep the min versions consistent.

A script called check-prerequisites.sh that does nothing but simply has bash functions doesn't make much sense.

@nija-at nija-at removed the pr/do-not-merge This PR should not be merged at this time. label Nov 25, 2020
@NetaNir
Copy link
Contributor Author

NetaNir commented Nov 25, 2020

@nija Im not sure accepting the stage will make it better, I think that splitting the scrips makes it cleaner. The check-prerequisites.sh is a util file, I agree it can be named better. Let me know if changing the name of the check-prerequisites.sh file to check-prerequisites-util.sh is sufficient and I will make the change.

@NetaNir NetaNir requested a review from nija-at November 30, 2020 17:43
@rix0rrr
Copy link
Contributor

rix0rrr commented Dec 1, 2020

I agree that it could maybe be factored some more, there's a lot of repetition now.

Don't mind 2 entry-level scripts that use functions from another script. I kind of like the straightforwardness of everything.

This is better than what we had, so why not move forward an inch (instead of a mile?)

Copy link
Contributor

@nija-at nija-at left a comment

Choose a reason for hiding this comment

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

The check-prerequisites.sh is a util file, I agree it can be named better. Let me know if changing the name of the check-prerequisites.sh file to check-prerequisites-util.sh is sufficient and I will make the change.

I would just get rid of the check-prerequisites.sh file and duplicate the 6ish lines of code in both files. It's not that much to keep in a common bash file.

However, if you want to keep it as a separate file, I would call it prerequisites.bash where .bash suffix indicates that it's not a script. Also, make sure to remove the 'x' flag so that it's no longer an executable.

@NetaNir NetaNir requested review from nija-at and removed request for ericzbeard December 3, 2020 03:45
@NetaNir
Copy link
Contributor Author

NetaNir commented Dec 3, 2020

@nija-at removed the util file.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 1df6651
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Dec 3, 2020

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 7458a91 into master Dec 3, 2020
@mergify mergify bot deleted the neta/split-prereq-check branch December 3, 2020 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants