-
Notifications
You must be signed in to change notification settings - Fork 81
Add CI utility scripts to the go build image from a versioned container #907
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| ARG TARGETARCH=${TARGETARCH} | ||
|
|
||
| # Bump to pick up a change to the Argo CI helper scripts copied in near the end. | ||
| ARG CI_SCRIPTS_VERSION=v1 | ||
| FROM calico/ci-scripts:${CI_SCRIPTS_VERSION} AS ci-scripts | ||
|
|
||
| FROM almalinux:9 AS builder | ||
|
|
||
| ARG TARGETARCH | ||
|
|
@@ -50,6 +54,7 @@ RUN set -eux; \ | |
| pcre-devel \ | ||
| pigz \ | ||
| pkg-config \ | ||
| sudo \ | ||
| wget \ | ||
| xz \ | ||
| zip | ||
|
|
@@ -306,9 +311,14 @@ COPY bin/semvalidator-${TARGETARCH} /usr/local/bin/semvalidator | |
| # Install Argo CI helper scripts so this image can serve as the base for Argo | ||
| # workflows, which have no pre-checkout step. Semaphore runners do their own | ||
| # checkout and ignore these. | ||
| COPY scripts/checkout.sh /usr/local/bin/checkout | ||
| COPY scripts/setup-github-ssh.sh /usr/local/bin/setup-github-ssh | ||
| COPY scripts/create-local-secret.sh /usr/local/bin/create-local-secret | ||
| COPY --from=ci-scripts / /usr/local/bin/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can copy from /from-script-name to /usr/local/bin/to-script-name so no need to run ln later.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the ln is to allow the script to be called with either name
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. It is better to do an explicit copy from the source to the target (like the lines you removed), rather than all files under |
||
|
|
||
| # Some callers use the kebab-case spellings; alias them so there is one | ||
| # implementation rather than two that can disagree. | ||
| RUN set -eux; \ | ||
| cd /usr/local/bin; \ | ||
| ln -sf setupGithubSSH setup-github-ssh; \ | ||
| ln -sf createLocalSecret create-local-secret | ||
|
|
||
| COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
|
|
||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
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.
Why do we need sudo now?
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.
The checkout script uses sudo to chmod on the checked out directory to give broader write permissions
https://github.com/tigera/cc-utils/blob/tsla-11651-pre/argoci-images/common-scripts/checkout#L34
we do support no-sudo as an option so if you would prefer I can remove this