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 Pipeline def for snc builder #29

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/snc-runner-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:
if [[ ! -f snc-runner/tkn/task.yaml ]]; then
exit 1
fi
if [[ ! -f snc-runner/tkn/pipeline.yaml ]]; then
exit 1
fi
# Check if version is in sync

- name: Create k8s Kind Cluster
Expand All @@ -77,12 +80,13 @@ jobs:
- name: Deploy tasks
run: |
kubectl apply -f snc-runner/tkn/task.yaml
kubectl apply -f snc-runner/tkn/pipeline.yaml

- name: Upload crc-builder-tkn
uses: actions/upload-artifact@v4
with:
name: snc-runner-tkn
path: snc-runner/tkn/task.yaml
path: snc-runner/tkn/*.yaml



3 changes: 2 additions & 1 deletion .github/workflows/snc-runner-pusher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ jobs:
curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz"
tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn
./tkn bundle push ${{ env.image }}-tkn \
-f task.yaml
-f task.yaml \
-f pipeline.yaml
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ endif

snc-runner-tkn-create:
$(call tkn_template,$(SNC_RUNNER),$(SNC_RUNNER_V),snc-runner,task)
$(call tkn_template,$(SNC_RUNNER),$(SNC_RUNNER_V),snc-runner,pipeline)

snc-runner-tkn-push: install-out-of-tree-tools
ifndef IMAGE
IMAGE = $(SNC_RUNNER):$(SNC_RUNNER_V)
endif
$(TOOLS_BINDIR)/tkn bundle push $(IMAGE)-tkn \
-f snc-runner/tkn/task.yaml
-f snc-runner/tkn/task.yaml \
-f snc-runner/tkn/pipeline.yaml

#### crc-builder ####

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@ git tag crc-builder-v1.0.0
# Here the gh builder flow for the ci action will create oci image and bundle with tekton tasks
git push upstream crc-builder-v1.0.0
# Change version on release-info to next version
```
```

## testing PRs

Manually run make XXX-tkn-create, then;

Typically PRs will be composed of images, tasks and pipelines:

* Pipelines and tasks can use git resolver using the forked repo source for the PR
* Task which needs the image need to be updated with the ghcr image

A testing commit can be done at very last part of the PR to test this customizations which then can be used
from a pipelinerun with a pipelineref to the forked repo source for the pr.

If everything works just revert and dismiss latest commit and create a tag
43 changes: 43 additions & 0 deletions snc-runner/tkn/samples/pipelinerun.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: crc-ocp-4.17.0-rc.5-arm64-
spec:
pipelineRef:
resolver: git
params:
- name: url
value: https://github.com/crc-org/ci-definitions.git
- name: revision
value: main
- name: pathInRepo
value: snc-runner/tkn/pipeline.yaml
params:
- name: arch
value: arm64
- name: ocp-index-url
value: https://mirror.openshift.com/pub/openshift-v4/arm64/clients/ocp/4.17.0-rc.5
- name: snc-ref
value: release-4.17
- name: ocp-extended-cert
value: enabled
- name: debug
value: 'true'
workspaces:
- name: storage
persistentVolumeClaim:
claimName: XXXXX
- name: s3-credentials
secret:
secretName: XXXXX
- name: aws-credentials
secret:
secretName: XXXXX
- name: rh-account-secret
secret:
secretName: XXXXX
- name: ocp-pullsecret
secret:
secretName: XXXXX
timeout: "8h"
Loading