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

Add Tekton Bundle workflow #3

Merged
merged 6 commits into from
May 5, 2022

Conversation

parasense
Copy link
Contributor

Signed-off-by: Jon Disnard jdisnard@redhat.com

Signed-off-by: Jon Disnard <jdisnard@redhat.com>
@parasense
Copy link
Contributor Author

For now this is very basic, and missing desirable features.
For example, as of this writing it has no mechanism to bump the image tag version string when pushing to Quay.
Also, for now it only works on one bundle, hello-world, but in the future it would be great to have all hosted bundles pushed.
Apparently Tekton requires kerbernets, so this workflow creates a tiny k3s based kubernetes instance, and is then able to use the Tekton CLI against the hosted Bundle yaml files.

* each dirname is the bundle/quay-repo name.
* inside bundle dirs is where pipeline/task yaml's are stored
* This pushes each bundle to quay.io, repos must be created ahead.
* Quay robot/token setup on GitHub secrets config page.

Signed-off-by: Jon Disnard <jdisnard@redhat.com>
@parasense
Copy link
Contributor Author

Please take another look.
It's converging on the acceptance criteria in https://issues.redhat.com/browse/HACBS-227
For now the one missing feature is ability to create NEW bundle repos on quay.io, as new bundles appear in GitHub. For the time being quay.io repos have to be created by hand, with robot tokens setup, etc..
For that I'll probably use a new PR.

.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Show resolved Hide resolved
@parasense
Copy link
Contributor Author

Note to self:
tektoncd/cli#1557 <-- action item: fix TKN CLI to avoid requiring kube config for bundle push/list

* set fetch depth=2 so we can diff previous commit
* look at the diff to see changed files
* only process bundle dirs that had changed files
* drop `kubectl` download, it's not required
* simplify the fake `.kube/conf` to bare minimum

Signed-off-by: Jon Disnard <jdisnard@redhat.com>
Signed-off-by: Jon Disnard <jdisnard@redhat.com>
@parasense
Copy link
Contributor Author

With the most recent commit, I believe we have finally addressed all the acceptance criteria in https://issues.redhat.com/browse/HACBS-227
Please take another look at the action/workflow, and let me know that could improve in terms of scripting or whatever.

Copy link
Collaborator

@davidmogar davidmogar left a comment

Choose a reason for hiding this comment

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

Much better, although I haven't tested it. Trusting you here.

As I side note, and leaving the decision up to you, do you think that would be better to move the script ot a separate file ?

The project structure I'd propose (easy to change), would be something like:

.github
definitions
    hello-world
        task-echo.yaml
        pipeline-release.yaml
    foo
        resources.yaml
scripts
.yamllint
LICENSE
README.md

I included stuff that I think this project should have as well.

.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
* Move bundles into definitions directory
* Various scripting clean-ups
* Sprinked a few printf's to provide workflow feedback.

Signed-off-by: Jon Disnard <jdisnard@redhat.com>
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
.github/workflows/tekton_bundle_push.yaml Outdated Show resolved Hide resolved
@parasense parasense removed the request for review from scoheb May 5, 2022 00:58
@parasense
Copy link
Contributor Author

Please click the approve so we can get this merged, and so I can setup that demo using this repo. Thanks in advance!

* SHA256 string is now 7 chars long instead of 8
* quay namespace is now hardcoded
* prevent consecutive hyphens or underscore chars in the file path.

Signed-off-by: Jon Disnard <jdisnard@redhat.com>
@parasense parasense merged commit 2ec0dc6 into konflux-ci:main May 5, 2022
@parasense parasense deleted the jdisnard_feature_3 branch May 5, 2022 10:21
Troy876 pushed a commit to Troy876/release-service-catalog that referenced this pull request Aug 16, 2023
Run go mod tidy and fix syntax error in suite_test.go
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.

3 participants