Skip to content

Commit ddae45a

Browse files
author
Alberto Fanjul
committed
chore: migrate crc-e2e
1 parent 4eb78ab commit ddae45a

File tree

7 files changed

+489
-1
lines changed

7 files changed

+489
-1
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: crc-e2e-builder
2+
3+
on:
4+
push:
5+
tags: [ 'crc-e2e-v*' ]
6+
pull_request:
7+
branches: [ main ]
8+
paths: ['crc-e2e/**', '.github\/workflows\/crc-e2e*' ]
9+
10+
jobs:
11+
build:
12+
name: build
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
# Allow emulation for building multi arch images
19+
- name: Prepare runner
20+
shell: bash
21+
run: |
22+
sudo apt-get install -y qemu-user-static
23+
24+
- name: Build image for PR
25+
if: ${{ github.event_name == 'pull_request' }}
26+
env:
27+
CRC_E2E: ghcr.io/crc-org/ci-crc-e2e
28+
CRC_E2E_V: pr-${{ github.event.number }}
29+
run: |
30+
make crc-e2e-oci-build
31+
make crc-e2e-oci-save
32+
echo "image=${CRC_E2E}:${CRC_E2E_V}" >> "$GITHUB_ENV"
33+
34+
- name: Build image for Release
35+
if: ${{ github.event_name == 'push' }}
36+
run: |
37+
make crc-e2e-oci-build
38+
make crc-e2e-oci-save
39+
echo "image=$(sed -n 1p crc-e2e/release-info):v$(sed -n 2p crc-e2e/release-info)" >> "$GITHUB_ENV"
40+
41+
- name: Create image metadata
42+
run: |
43+
echo ${{ env.image }} > crc-e2e-image
44+
echo ${{ github.event_name }} > crc-e2e-build-event
45+
46+
- name: Upload crc-e2e
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: crc-e2e
50+
path: crc-e2e*
51+
52+
tkn-check:
53+
runs-on: ubuntu-24.04
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Template tkn for PR
59+
if: ${{ github.event_name == 'pull_request' }}
60+
env:
61+
CRC_E2E: ghcr.io/crc-org/ci-crc-e2e
62+
CRC_E2E_V: pr-${{ github.event.number }}
63+
run: |
64+
make crc-e2e-tkn-create
65+
66+
- name: Check tkn specs
67+
run: |
68+
if [[ ! -f crc-e2e/tkn/crc-e2e-installer.yaml ]]; then
69+
exit 1
70+
fi
71+
if [[ ! -f crc-e2e/tkn/crc-e2e.yaml ]]; then
72+
exit 1
73+
fi
74+
# Check if version is in sync
75+
76+
- name: Create k8s Kind Cluster
77+
uses: helm/kind-action@v1
78+
79+
# https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html
80+
- name: Deploy min supported tekton version
81+
run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml
82+
83+
- name: Deploy tasks
84+
run: |
85+
kubectl apply -f crc-e2e/tkn/crc-e2e-installer.yaml
86+
kubectl apply -f crc-e2e/tkn/crc-e2e.yaml
87+
88+
- name: Upload crc-e2e-tkn
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: crc-e2e-tkn
92+
path: crc-e2e/tkn/crc-e2e*
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: crc-e2e-pusher
2+
3+
on:
4+
workflow_run:
5+
workflows: crc-e2e-builder
6+
types:
7+
- completed
8+
9+
jobs:
10+
push:
11+
name: push
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Download crc-e2e assets
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: crc-e2e
22+
run-id: ${{ github.event.workflow_run.id }}
23+
github-token: ${{ github.token }}
24+
25+
- name: Get crc-e2e build informaiton
26+
run: |
27+
echo "source_event=$(cat crc-e2e-build-event)" >> "$GITHUB_ENV"
28+
echo "image=$(cat crc-e2e-image)" >> "$GITHUB_ENV"
29+
30+
- name: Log in to ghcr.io
31+
if: ${{ env.source_event == 'pull_request' }}
32+
uses: redhat-actions/podman-login@v1
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Log in quay.io
39+
if: ${{ env.source_event == 'push' }}
40+
uses: redhat-actions/podman-login@v1
41+
with:
42+
registry: quay.io
43+
username: ${{ secrets.QUAY_IO_USERNAME }}
44+
password: ${{ secrets.QUAY_IO_PASSWORD }}
45+
46+
- name: Push crc-e2e
47+
run: |
48+
podman load -i crc-e2e-linux.tar
49+
podman push ${{ env.image }}-linux
50+
podman load -i crc-e2e-windows.tar
51+
podman push ${{ env.image }}-windows
52+
podman load -i crc-e2e-darwin.tar
53+
podman push ${{ env.image }}-darwin
54+
55+
- name: Download crc-e2e-tkn assets
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: crc-e2e-tkn
59+
run-id: ${{ github.event.workflow_run.id }}
60+
github-token: ${{ github.token }}
61+
62+
- name: Push crc-e2e-tkn
63+
env:
64+
TKN_VERSION: '0.37.0'
65+
run: |
66+
curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz"
67+
tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn
68+
./tkn bundle push ${{ env.image }}-tkn \
69+
-f crc-e2e-installer.yaml \
70+
-f crc-e2e.yaml
71+
72+

Makefile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,22 @@ endif
107107
-f crc-builder/tkn/crc-builder-installer.yaml \
108108
-f crc-builder/tkn/crc-builder.yaml \
109109
-f crc-builder/tkn/crc-builder-arm64.yaml
110-
110+
111+
#### crc-e2e ####
112+
113+
.PHONY: crc-e2e-tkn-create crc-e2e-tkn-push
114+
115+
# Registries and versions
116+
CRC_E2E ?= $(shell sed -n 1p crc-e2e/release-info)
117+
CRC_E2E_V ?= v$(shell sed -n 2p crc-e2e/release-info)
118+
CRC_E2E_SAVE ?= crc-e2e
119+
120+
crc-e2e-tkn-create:
121+
$(call tkn_template,$(CRC_E2E),$(CRC_E2E_V),crc-e2e,crc-e2e)
122+
123+
crc-e2e-tkn-push: install-out-of-tree-tools
124+
ifndef IMAGE
125+
IMAGE = $(CRC_E2E):$(CRC_E2E_V)
126+
endif
127+
$(TOOLS_BINDIR)/tkn bundle push $(IMAGE)-tkn \
128+
-f crc-e2e/tkn/crc-e2e.yaml

crc-e2e/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
## 1.0.0
4+
5+
* Initial version for managinig 2 types of builders
6+
* linux multi arch container based
7+
* windows and mac build on remote target
8+
9+

crc-e2e/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# CRC e2e
2+
3+
## Modifications to the image
4+
5+
Changes to `crc-e2e/os/macos/builder/build.sh` require re-building and pushing the image to internal registry (ImageStream). Make sure the changes are pushed to some `mybranch` on your fork of the QE platform repo (`github.com/<your-username>/qe-platform`). Since the `crc-e2e/manifests/buildconfig.yaml` will be guiding the build of the image, it needs to specify your branch on your fork as the source.
6+
7+
```diff
8+
source:
9+
contextDir: support/images/crc-e2e
10+
git:
11+
# dev
12+
+ ref: 'mybranch'
13+
+ uri: 'https://gitlab.cee.redhat.com/<your-username>/qe-platform.git'
14+
- ref: v2.14.0
15+
- uri: 'https://gitlab.cee.redhat.com/crc/qe-platform.git'
16+
type: Git
17+
```
18+
19+
Log in to `codeready-container` project, apply the changes in `crc-e2e/manifests/buildconfig.yaml` and start the build from the corresponding `BuildConfig` (depending on the platform).
20+
21+
```bash
22+
oc apply -f support/images/crc-e2e/manifests/buildconfig.yaml
23+
oc start-build image-crc-e2e-<platform>
24+
```
25+
26+
Lastly, make sure that `imagePullPolicy` is set to `Always` in all places that use this imageStreamTag (e.g. `crc-e2e:v0.0.3-macos`). In our case, we needed to change and re-apply the following YAML.
27+
28+
```bash
29+
oc apply -f orchestrator/catalog/task/crc-e2e-installer/0.3/crc-e2e-installer.yaml
30+
```
31+
32+
Then undo changes to `crc-e2e/manifests/buildconfig.yaml` so it points to the upstream repository.
33+
34+
_If everything works as expected, send an MR to `gitlab.cee.redhat.com/crc/qe-platform`._
35+

crc-e2e/release-info

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
quay.io/crc-org/ci-crc-e2e
2+
1.0.0-dev

0 commit comments

Comments
 (0)