-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (130 loc) · 8.47 KB
/
trigger-layered.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
name: layered images trigger
on:
workflow_dispatch:
schedule:
- cron: '0 20 * * 0'
jobs:
check-image:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/bootc-workflow-report'
runs-on: container-runner
container:
image: quay.io/fedora/fedora:39
options: --privileged
steps:
- name: Check RHEL 9 image info
id: check_image_layered
run: |
sudo dnf install -y podman skopeo jq
RHEL_IMAGE_DIGEST=$(skopeo inspect --tls-verify=false "docker://${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" | jq -r '.Digest')
RHEL_IMAGE_VERSION=$(skopeo inspect --tls-verify=false "docker://${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" | jq -r '.Labels."org.opencontainers.image.version"')
RHEL_KERNEL_VERSION=$(skopeo inspect --tls-verify=false "docker://${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" | jq -r '.Labels."ostree.linux"')
RHEL_COMPOSE_ID=$(skopeo inspect --tls-verify=false "docker://${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" | jq -r '.Labels."redhat.compose-id"')
RHEL_BOOTC_VERSION=$(podman run --tls-verify=false --rm "${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" rpm -qa | grep bootc)
RHEL_OSTREE_VERSION=$(podman run --tls-verify=false --rm "${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" rpm -qa | grep "^ostree-2")
RHEL_BOOTUPD_VERSION=$(podman run --tls-verify=false --rm "${RHEL_REGISTRY_URL}/rhel9-rhel_bootc:rhel-9.4" rpm -qa | grep bootupd)
CS_IMAGE_DIGEST=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Digest')
CS_IMAGE_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels."org.opencontainers.image.version"')
CS_KERNEL_VERSION=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels."ostree.linux"')
CS_COMPOSE_ID=$(skopeo inspect docker://quay.io/centos-bootc/centos-bootc:stream9 | jq -r '.Labels."redhat.compose-id"')
CS_BOOTC_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc:stream9 rpm -qa | grep bootc)
CS_OSTREE_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc:stream9 rpm -qa | grep "^ostree-2")
CS_BOOTUPD_VERSION=$(podman run --rm quay.io/centos-bootc/centos-bootc:stream9 rpm -qa | grep bootupd)
echo "rhel_image_digest=$RHEL_IMAGE_DIGEST" >> $GITHUB_OUTPUT
echo "rhel_image_version=$RHEL_IMAGE_VERSION" >> $GITHUB_OUTPUT
echo "rhel_kernel_version=$RHEL_KERNEL_VERSION" >> $GITHUB_OUTPUT
echo "rhel_compose_id=$RHEL_COMPOSE_ID" >> $GITHUB_OUTPUT
echo "rhel_bootc_version=$RHEL_BOOTC_VERSION" >> $GITHUB_OUTPUT
echo "rhel_ostree_version=$RHEL_OSTREE_VERSION" >> $GITHUB_OUTPUT
echo "rhel_bootupd_version=$RHEL_BOOTUPD_VERSION" >> $GITHUB_OUTPUT
echo "cs_image_digest=$RHEL_IMAGE_DIGEST" >> $GITHUB_OUTPUT
echo "cs_image_version=$RHEL_IMAGE_VERSION" >> $GITHUB_OUTPUT
echo "cs_kernel_version=$RHEL_KERNEL_VERSION" >> $GITHUB_OUTPUT
echo "cs_compose_id=$RHEL_COMPOSE_ID" >> $GITHUB_OUTPUT
echo "cs_bootc_version=$RHEL_BOOTC_VERSION" >> $GITHUB_OUTPUT
echo "cs_ostree_version=$RHEL_OSTREE_VERSION" >> $GITHUB_OUTPUT
echo "cs_bootupd_version=$RHEL_BOOTUPD_VERSION" >> $GITHUB_OUTPUT
env:
RHEL_REGISTRY_URL: ${{ secrets.RHEL_REGISTRY_URL }}
outputs:
rhel_image_digest: ${{ steps.check_image_layered.outputs.rhel_image_digest }}
rhel_image_version: ${{ steps.check_image_layered.outputs.rhel_image_version }}
rhel_kernel_version: ${{ steps.check_image_layered.outputs.rhel_kernel_version }}
rhel_compose_id: ${{ steps.check_image_layered.outputs.rhel_compose_id }}
rhel_bootc_version: ${{ steps.check_image_layered.outputs.rhel_bootc_version }}
rhel_ostree_version: ${{ steps.check_image_layered.outputs.rhel_ostree_version }}
rhel_bootupd_version: ${{ steps.check_image_layered.outputs.rhel_bootupd_version }}
cs_image_digest: ${{ steps.check_image_layered.outputs.cs_image_digest }}
cs_image_version: ${{ steps.check_image_layered.outputs.cs_image_version }}
cs_kernel_version: ${{ steps.check_image_layered.outputs.cs_kernel_version }}
cs_compose_id: ${{ steps.check_image_layered.outputs.cs_compose_id }}
cs_bootc_version: ${{ steps.check_image_layered.outputs.cs_bootc_version }}
cs_ostree_version: ${{ steps.check_image_layered.outputs.cs_ostree_version }}
cs_bootupd_version: ${{ steps.check_image_layered.outputs.cs_bootupd_version }}
create-pr:
needs: check-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Save tested container image digest
run: echo "${{ needs.check-image.outputs.image_digest }}" >> pr_files/pr_file.rhel
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "build: layered image rhel9-rhel_bootc:rhel-9.4 - ${{ needs.check-image.outputs.rhel_image_version }} - centos-bootc:stream9 - ${{ needs.check-image.outputs.cs_image_version }} - ${{ steps.date.outputs.date }}"
committer: cloudkitebot <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: cpr
branch-suffix: random
delete-branch: true
title: "rhel9-rhel_bootc:rhel-9.4 - ${{ needs.check-image.outputs.rhel_image_version }} - centos-bootc:stream9 - ${{ needs.check-image.outputs.cs_image_version }} - ${{ steps.date.outputs.date }}"
labels: auto-merge,rhel9-rhel_bootc:rhel-9.4,centos-bootc:stream9
body: |
rhel9-rhel_bootc:rhel-9.4 image ${{ needs.check-image.outputs.rhel_image_version }}
- Date: ${{ steps.date.outputs.date }}
- Image Digest: ${{ needs.check-image.outputs.rhel_image_digest }}
- Image Version: ${{ needs.check-image.outputs.rhel_image_version }}
- Kernel Version: ${{ needs.check-image.outputs.rhel_kernel_version }}
- Compose ID: ${{ needs.check-image.outputs.rhel_compose_id }}
- bootc Version: ${{ needs.check-image.outputs.rhel_bootc_version }}
- ostree Version: ${{ needs.check-image.outputs.rhel_ostree_version }}
- bootupd Version: ${{ needs.check-image.outputs.rhel_bootupd_version }}
centos-bootc:stream9 image ${{ needs.check-image.outputs.cs_image_version }}
- Date: ${{ steps.date.outputs.date }}
- Image URL: quay.io/centos-bootc/centos-bootc:stream9
- Image Digest: ${{ needs.check-image.outputs.cs_image_digest }}
- Image Version: ${{ needs.check-image.outputs.cs_image_version }}
- Kernel Version: ${{ needs.check-image.outputs.cs_kernel_version }}
- Compose ID: ${{ needs.check-image.outputs.cs_compose_id }}
- bootc Version: ${{ needs.check-image.outputs.cs_bootc_version }}
- ostree Version: ${{ needs.check-image.outputs.cs_ostree_version }}
- bootupd Version: ${{ needs.check-image.outputs.cs_bootupd_version }}
Test includes OS replace test and anaconda installation test
- The OS replace test will use `bootc install` command inside bootc container image to install bootc OCI Image
- The anaconda test will install the bootc OCI image from kickstart command `ostreecontainer`
- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: rebase
- name: Add a comment to trigger test workflow
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.PAT }}
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body: /test-layered-images
- name: Create a project card to track compose test result
uses: peter-evans/create-or-update-project-card@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
project-name: bootc test
column-name: layered_images
issue-number: ${{ steps.cpr.outputs.pull-request-number }}