Skip to content

Add CI utility scripts to the go build image from a versioned container - #907

Open
RoryDoherty wants to merge 1 commit into
projectcalico:masterfrom
RoryDoherty:add-ci-scripts
Open

Add CI utility scripts to the go build image from a versioned container#907
RoryDoherty wants to merge 1 commit into
projectcalico:masterfrom
RoryDoherty:add-ci-scripts

Conversation

@RoryDoherty

Copy link
Copy Markdown

Copies the scripts in from a versioned image instead of trying to keep the scripts updated in two locations at once

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/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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
The scripts that were removed are using kebab-case for the names whereas ArgoCI uses camelCase for the script names
I added the ln so that it doesn't break any existing CI that might be using the kebab-case method calls

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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 / to /usr/local/bin. We don't want files or folders to get overwritten without realizing it. Being explicit will also make the build fail loudly if the source file doesn't exist.

pcre-devel \
pigz \
pkg-config \
sudo \

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Author

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

@hjiawei hjiawei self-assigned this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants