Skip to content

Commit bbdcfda

Browse files
author
openshift-pipelines-bot
committed
[bot:release-v1.22.x] update konflux configuration
Generated by workflow [Generate konflux configurations](https://github.com/openshift-pipelines/hack/actions/runs/25891473468) Triggered by pramodbindal
1 parent b7a2245 commit bbdcfda

1 file changed

Lines changed: 74 additions & 56 deletions

File tree

.github/workflows/update-sources.yaml

Lines changed: 74 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
workflow_dispatch: {}
55
push:
66
branches:
7-
- release-v1.22.x
7+
- release-v1.22.x
88
paths:
9-
- .github/workflows/update-sources.yaml
9+
- .github/workflows/update-sources.yaml
1010
jobs:
1111
update-sources:
1212
# This line prevents the job from running if CodeFreeze is true
@@ -16,62 +16,80 @@ jobs:
1616
contents: write
1717
pull-requests: write
1818
steps:
19-
- name: Checkout the current repo
20-
uses: actions/checkout@v4
21-
with:
22-
ref: release-v1.22.x
19+
- name: Checkout the current repo
20+
uses: actions/checkout@v4
21+
with:
22+
ref: release-v1.22.x
2323

24-
- name: Clone konflux-ci/tekton-kueue
25-
run: |
26-
rm -fR upstream
27-
git clone https://github.com/konflux-ci/tekton-kueue upstream
28-
pushd upstream
29-
git checkout -B release-v0.3.x origin/release-v0.3.x
30-
popd
31-
- name: Commit new changes
32-
run: |
24+
- name: Clone konflux-ci/tekton-kueue
25+
run: |
26+
rm -fR upstream
27+
git clone https://github.com/konflux-ci/tekton-kueue upstream
28+
pushd upstream
29+
git checkout -B release-v0.3.x origin/release-v0.3.x
30+
popd
31+
- name: update-rpms
32+
continue-on-error: true
33+
run: |
34+
set -x
35+
export BASE_IMAGE=$(grep -h "RUNTIME=" .konflux/dockerfiles/* | sed -E 's/.*RUNTIME=["'\'']?([^"'\'' ]+).*/\1/' | head -n 1)
36+
docker run --rm\
37+
-e BASE_IMAGE=$BASE_IMAGE \
38+
-v ./.konflux/rpms/:/rpms -w /rpms $BASE_IMAGE sh -c "
39+
cp -f /etc/yum.repos.d/*.repo ./
40+
sed -i 's/^\[ubi-9-/\[ubi-9-for-\$basearch-/' *.repo
41+
"
42+
docker run --rm\
43+
-e BASE_IMAGE=$BASE_IMAGE \
44+
-v ./.konflux/rpms/:/rpms -w /rpms registry.access.redhat.com/ubi9/ubi-minimal:latest sh -c "
45+
microdnf update -y && microdnf install -y python3-dnf skopeo pip
46+
python3 -m pip install https://github.com/konflux-ci/rpm-lockfile-prototype/archive/refs/tags/v0.21.0.tar.gz
47+
rpm-lockfile-prototype --image $BASE_IMAGE rpms.in.yaml
48+
"
49+
- name: Commit new changes
50+
run: |
3351
34-
set -x
52+
set -x
3553
36-
git config user.name openshift-pipelines-bot
37-
git config user.email pipelines-extcomm@redhat.com
38-
git checkout -b actions/update/sources-release-v1.22.x
39-
touch head
40-
pushd upstream
41-
OLD_COMMIT=$(cat ../head)
42-
NEW_COMMIT=$(git rev-parse HEAD)
43-
echo Previous commit: ${OLD_COMMIT}
44-
git show --stat ${OLD_COMMIT}
45-
echo New commit: ${NEW_COMMIT}
46-
git show --stat ${NEW_COMMIT}
47-
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
48-
git rev-parse HEAD > ../head
49-
popd
50-
rm -rf upstream/.git
51-
git add -f upstream head .konflux
52-
53-
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
54-
echo "No change, exiting"
55-
exit 0
56-
fi
57-
58-
git commit -F- <<EOF
54+
git config user.name openshift-pipelines-bot
55+
git config user.email pipelines-extcomm@redhat.com
56+
git checkout -b actions/update/sources-release-v1.22.x
57+
touch head
58+
pushd upstream
59+
OLD_COMMIT=$(cat ../head)
60+
NEW_COMMIT=$(git rev-parse HEAD)
61+
echo Previous commit: ${OLD_COMMIT}
62+
git show --stat ${OLD_COMMIT}
63+
echo New commit: ${NEW_COMMIT}
64+
git show --stat ${NEW_COMMIT}
65+
git diff --stat ${NEW_COMMIT}..${OLD_COMMIT} > /tmp/diff.txt
66+
git rev-parse HEAD > ../head
67+
popd
68+
rm -rf upstream/.git
69+
git add -f upstream head .konflux
70+
71+
if [[ -z $(git status --porcelain --untracked-files=no) ]]; then
72+
echo "No change, exiting"
73+
exit 0
74+
fi
75+
76+
git commit -F- <<EOF
5977
[bot] Update release-v1.22.x from konflux-ci/tekton-kueue:release-v0.3.x to ${NEW_COMMIT}
60-
61-
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
62-
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
63-
64-
https://github.com/konflux-ci/tekton-kueue/compare/${NEW_COMMIT}..${OLD_COMMIT}
65-
EOF
66-
67-
git push -f origin actions/update/sources-release-v1.22.x
68-
69-
if [ "$(gh pr list --base release-v1.22.x --head actions/update/sources-release-v1.22.x --json url --jq 'length')" = "0" ]; then
70-
echo "creating PR..."
71-
gh pr create -B release-v1.22.x -H actions/update/sources-release-v1.22.x --label=automated --label=upstream --fill
72-
else
73-
echo "a PR already exists, editing..."
78+
79+
$ git diff --stat ${NEW_COMMIT}..${OLD_COMMIT}
80+
$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)
81+
82+
https://github.com/konflux-ci/tekton-kueue/compare/${NEW_COMMIT}..${OLD_COMMIT}
83+
EOF
84+
85+
git push -f origin actions/update/sources-release-v1.22.x
86+
87+
if [ "$(gh pr list --base release-v1.22.x --head actions/update/sources-release-v1.22.x --json url --jq 'length')" = "0" ]; then
88+
echo "creating PR..."
89+
gh pr create -B release-v1.22.x -H actions/update/sources-release-v1.22.x --label=automated --label=upstream --fill
90+
else
91+
echo "a PR already exists, editing..."
7492
gh pr edit --title "[bot] Update release-v1.22.x from konflux-ci/tekton-kueue:release-v0.3.x to ${NEW_COMMIT}" --body "$(cat /tmp/diff.txt | sed 's/^/ /' | head -c 55555)"
75-
fi
76-
env:
77-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
fi
94+
env:
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)