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

Bring in cosign sign and attest support and fix verify-enterprise-contract #1

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

simonbaird
Copy link
Contributor

@simonbaird simonbaird commented Jul 30, 2024

These changes come from the following PR:
redhat-appstudio/tssc-dev-multi-ci#2
See commit messages for more details on these changes.

Initial diff generated with hack/copy-to-tssc-templates in that repo, but I added cosign_sign_attest to the rhtap.grooy file by hand.

See also: redhat-appstudio/tssc-sample-templates#63

Ref: EC-740

resources/cosign-sign-attest.sh Outdated Show resolved Hide resolved
done | sort -u > "$IMAGES_FILE"

# For development purposes, allow injecting your own list of images
if [ -n "${MY_IMAGES_TO_VERIFY}" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

won't the script fail if MY_IMAGES_TO_VERIFY is unset (because of set -u)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good catch.

Suggested change
if [ -n "${MY_IMAGES_TO_VERIFY}" ]; then
if [ -n "${MY_IMAGES_TO_VERIFY:-}" ]; then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in an upcoming revision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually maybe this could be removed entirely. It was useful when I was testing this in the tssc-jenkins repo, but perhaps it could be dropped for this repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Decided to remove it from the next revision.)

resources/init.sh Outdated Show resolved Hide resolved
resources/init.sh Show resolved Hide resolved
resources/verify-enterprise-contract.sh Show resolved Hide resolved
@simonbaird
Copy link
Contributor Author

Thanks very much for the reviews. I'll aim to push a new revision later today.

simonbaird added a commit to simonbaird/build-definitions that referenced this pull request Aug 2, 2024
Short explanation: Clean up the code a little by using a variable.

Long explanation: This task gets converted to a bash script and
wrapped by a Jenkins shared library in the brand new RHTAP Jenkins
pipeline same templates. When testing the RHTAP Jenkins pipeline I
found the default Jenkins user could not write to /tmp/, so I wanted
to change the location of the file. This refactor makes that just a
single line change, rather than having to change the path in three
different places.

See also
redhat-appstudio/tssc-sample-jenkins#1
where this PR was suggested by @mmorhun, and also
redhat-appstudio/tssc-dev-multi-ci#2 where the cosign,
Enterprise Contract, and promote pipeline support was being added to
the RHTAP Jenkins templates.
simonbaird added a commit to simonbaird/build-definitions that referenced this pull request Aug 2, 2024
Short explanation: Clean up the code a little by using a variable.

Long explanation: This task gets converted to a bash script and
wrapped by a Jenkins shared library in the brand new RHTAP Jenkins
pipeline sample templates. When testing the RHTAP Jenkins pipeline I
found the default Jenkins user could not write to /tmp/, so I wanted
to change the location of the file. This refactor makes that just a
single line change, rather than having to change the path in three
places.

See also
redhat-appstudio/tssc-sample-jenkins#1
where this PR was suggested by @mmorhun, and also
redhat-appstudio/tssc-dev-multi-ci#2 where the cosign,
Enterprise Contract, and promote pipeline support was being added to
the RHTAP Jenkins templates.
github-merge-queue bot pushed a commit to konflux-ci/build-definitions that referenced this pull request Aug 5, 2024
Short explanation: Clean up the code a little by using a variable.

Long explanation: This task gets converted to a bash script and
wrapped by a Jenkins shared library in the brand new RHTAP Jenkins
pipeline sample templates. When testing the RHTAP Jenkins pipeline I
found the default Jenkins user could not write to /tmp/, so I wanted
to change the location of the file. This refactor makes that just a
single line change, rather than having to change the path in three
places.

See also
redhat-appstudio/tssc-sample-jenkins#1
where this PR was suggested by @mmorhun, and also
redhat-appstudio/tssc-dev-multi-ci#2 where the cosign,
Enterprise Contract, and promote pipeline support was being added to
the RHTAP Jenkins templates.
These changes come from the following PR:
redhat-appstudio/tssc-dev-multi-ci#2
See commit messages for more details on these changes.

Initial diff generated with hack/copy-to-tssc-templates in that
repo, but there were some manual tweaks done, including adding
cosign_sign_attest to the rhtap.groovy file, and removing the
some debugging code from rhtap/gather-deploy-images.sh related to
the MY_IMAGES_TO_VERIFY var.

Ref: https://issues.redhat.com/browse/EC-740
Copy link

sonarqubecloud bot commented Aug 5, 2024

@simonbaird
Copy link
Contributor Author

@chmeliik @mmorhun thanks for the reviews. I'm done tweaking here and ready for a re-review.

My thinking is we should merge this soon and make it available for QE folks who can try it out in a real RHTAP environment.

@simonbaird simonbaird changed the title Bring in cosign sign and attest support Bring in cosign sign and attest support and fix verify-enterprise-contract Aug 5, 2024
@flacatus flacatus merged commit 6cd5c4a into redhat-appstudio:main Aug 5, 2024
1 check passed
jduimovich pushed a commit to jduimovich/build-definitions that referenced this pull request Aug 6, 2024
Short explanation: Clean up the code a little by using a variable.

Long explanation: This task gets converted to a bash script and
wrapped by a Jenkins shared library in the brand new RHTAP Jenkins
pipeline sample templates. When testing the RHTAP Jenkins pipeline I
found the default Jenkins user could not write to /tmp/, so I wanted
to change the location of the file. This refactor makes that just a
single line change, rather than having to change the path in three
places.

See also
redhat-appstudio/tssc-sample-jenkins#1
where this PR was suggested by @mmorhun, and also
redhat-appstudio/tssc-dev-multi-ci#2 where the cosign,
Enterprise Contract, and promote pipeline support was being added to
the RHTAP Jenkins templates.
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.

5 participants