Skip to content

Commit 3b89e0a

Browse files
authored
USHIFT-6859: Run update-versions-release on 5.0, 4.21, 4.22 (#77829)
* Run update-versions-release on 5.0 * Change version arg to major.minor * Revert "Don't run update-versions-releases on 4.21, 4.22, 4.23 (#77774)" This reverts commit 4b2b5d4. * Skip GH release publish if no releases.json * Correct args depending on the cloned branch * Don't run update-versions-releases for 4.23
1 parent 5130643 commit 3b89e0a

5 files changed

Lines changed: 202 additions & 8 deletions

File tree

ci-operator/config/openshift/microshift/openshift-microshift-release-4.21__periodics.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ tests:
4141
cron: 0 5 * * 1-5
4242
steps:
4343
workflow: openshift-microshift-publish-release-notes
44+
- as: update-versions-releases
45+
cron: 0 5 * * 1-5
46+
steps:
47+
cluster_profile: openshift-org-aws
48+
env:
49+
EC2_INSTANCE_TYPE: t3.medium
50+
workflow: openshift-microshift-manage-versions-releases
4451
- as: e2e-aws-tests-cache-nightly
4552
capabilities:
4653
- intranet

ci-operator/config/openshift/microshift/openshift-microshift-release-4.22__periodics.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ tests:
4141
cron: 0 5 * * 1-5
4242
steps:
4343
workflow: openshift-microshift-publish-release-notes
44+
- as: update-versions-releases
45+
cron: 0 5 * * 1-5
46+
steps:
47+
cluster_profile: openshift-org-aws
48+
env:
49+
EC2_INSTANCE_TYPE: t3.medium
50+
workflow: openshift-microshift-manage-versions-releases
4451
- as: e2e-aws-tests-cache-nightly
4552
capabilities:
4653
- intranet

ci-operator/jobs/openshift/microshift/openshift-microshift-release-4.21-periodics.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,3 +1680,86 @@ periodics:
16801680
- name: result-aggregator
16811681
secret:
16821682
secretName: result-aggregator
1683+
- agent: kubernetes
1684+
cluster: build01
1685+
cron: 0 5 * * 1-5
1686+
decorate: true
1687+
decoration_config:
1688+
skip_cloning: true
1689+
extra_refs:
1690+
- base_ref: release-4.21
1691+
org: openshift
1692+
repo: microshift
1693+
labels:
1694+
ci-operator.openshift.io/cloud: aws
1695+
ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws
1696+
ci-operator.openshift.io/variant: periodics
1697+
ci.openshift.io/generator: prowgen
1698+
job-release: "4.21"
1699+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
1700+
name: periodic-ci-openshift-microshift-release-4.21-periodics-update-versions-releases
1701+
spec:
1702+
containers:
1703+
- args:
1704+
- --gcs-upload-secret=/secrets/gcs/service-account.json
1705+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
1706+
- --lease-server-credentials-file=/etc/boskos/credentials
1707+
- --report-credentials-file=/etc/report/credentials
1708+
- --secret-dir=/secrets/ci-pull-credentials
1709+
- --target=update-versions-releases
1710+
- --variant=periodics
1711+
command:
1712+
- ci-operator
1713+
env:
1714+
- name: HTTP_SERVER_IP
1715+
valueFrom:
1716+
fieldRef:
1717+
fieldPath: status.podIP
1718+
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
1719+
imagePullPolicy: Always
1720+
name: ""
1721+
ports:
1722+
- containerPort: 8080
1723+
name: http
1724+
resources:
1725+
requests:
1726+
cpu: 10m
1727+
volumeMounts:
1728+
- mountPath: /etc/boskos
1729+
name: boskos
1730+
readOnly: true
1731+
- mountPath: /secrets/ci-pull-credentials
1732+
name: ci-pull-credentials
1733+
readOnly: true
1734+
- mountPath: /secrets/gcs
1735+
name: gcs-credentials
1736+
readOnly: true
1737+
- mountPath: /secrets/manifest-tool
1738+
name: manifest-tool-local-pusher
1739+
readOnly: true
1740+
- mountPath: /etc/pull-secret
1741+
name: pull-secret
1742+
readOnly: true
1743+
- mountPath: /etc/report
1744+
name: result-aggregator
1745+
readOnly: true
1746+
serviceAccountName: ci-operator
1747+
volumes:
1748+
- name: boskos
1749+
secret:
1750+
items:
1751+
- key: credentials
1752+
path: credentials
1753+
secretName: boskos-credentials
1754+
- name: ci-pull-credentials
1755+
secret:
1756+
secretName: ci-pull-credentials
1757+
- name: manifest-tool-local-pusher
1758+
secret:
1759+
secretName: manifest-tool-local-pusher
1760+
- name: pull-secret
1761+
secret:
1762+
secretName: registry-pull-credentials
1763+
- name: result-aggregator
1764+
secret:
1765+
secretName: result-aggregator

ci-operator/jobs/openshift/microshift/openshift-microshift-release-4.22-periodics.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,3 +2340,86 @@ periodics:
23402340
- name: result-aggregator
23412341
secret:
23422342
secretName: result-aggregator
2343+
- agent: kubernetes
2344+
cluster: build01
2345+
cron: 0 5 * * 1-5
2346+
decorate: true
2347+
decoration_config:
2348+
skip_cloning: true
2349+
extra_refs:
2350+
- base_ref: release-4.22
2351+
org: openshift
2352+
repo: microshift
2353+
labels:
2354+
ci-operator.openshift.io/cloud: aws
2355+
ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws
2356+
ci-operator.openshift.io/variant: periodics
2357+
ci.openshift.io/generator: prowgen
2358+
job-release: "4.22"
2359+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
2360+
name: periodic-ci-openshift-microshift-release-4.22-periodics-update-versions-releases
2361+
spec:
2362+
containers:
2363+
- args:
2364+
- --gcs-upload-secret=/secrets/gcs/service-account.json
2365+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
2366+
- --lease-server-credentials-file=/etc/boskos/credentials
2367+
- --report-credentials-file=/etc/report/credentials
2368+
- --secret-dir=/secrets/ci-pull-credentials
2369+
- --target=update-versions-releases
2370+
- --variant=periodics
2371+
command:
2372+
- ci-operator
2373+
env:
2374+
- name: HTTP_SERVER_IP
2375+
valueFrom:
2376+
fieldRef:
2377+
fieldPath: status.podIP
2378+
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
2379+
imagePullPolicy: Always
2380+
name: ""
2381+
ports:
2382+
- containerPort: 8080
2383+
name: http
2384+
resources:
2385+
requests:
2386+
cpu: 10m
2387+
volumeMounts:
2388+
- mountPath: /etc/boskos
2389+
name: boskos
2390+
readOnly: true
2391+
- mountPath: /secrets/ci-pull-credentials
2392+
name: ci-pull-credentials
2393+
readOnly: true
2394+
- mountPath: /secrets/gcs
2395+
name: gcs-credentials
2396+
readOnly: true
2397+
- mountPath: /secrets/manifest-tool
2398+
name: manifest-tool-local-pusher
2399+
readOnly: true
2400+
- mountPath: /etc/pull-secret
2401+
name: pull-secret
2402+
readOnly: true
2403+
- mountPath: /etc/report
2404+
name: result-aggregator
2405+
readOnly: true
2406+
serviceAccountName: ci-operator
2407+
volumes:
2408+
- name: boskos
2409+
secret:
2410+
items:
2411+
- key: credentials
2412+
path: credentials
2413+
secretName: boskos-credentials
2414+
- name: ci-pull-credentials
2415+
secret:
2416+
secretName: ci-pull-credentials
2417+
- name: manifest-tool-local-pusher
2418+
secret:
2419+
secretName: manifest-tool-local-pusher
2420+
- name: pull-secret
2421+
secret:
2422+
secretName: registry-pull-credentials
2423+
- name: result-aggregator
2424+
secret:
2425+
secretName: result-aggregator

ci-operator/step-registry/openshift/microshift/manage-versions-releases/openshift-microshift-manage-versions-releases-commands.sh

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,34 @@ sudo subscription-manager repos --disable "rhocp-4.*-for-rhel-9-\$(uname -m)-rpm
5050
# Create dir as user, following sudo gen_gh_releases.sh script creates venv as root and prevents next command from creating a subdir.
5151
mkdir -p ./_output
5252
53-
# sudo to allowe dnf to update the cache
53+
# sudo to allow dnf to update the cache
5454
sudo -E ./scripts/release-notes/gen_gh_releases.sh rhocp --ci-job-branch "${BRANCH}" query --output /tmp/releases.json
5555
56-
cat /tmp/releases.json
57-
58-
APP_ID="\$(cat /tmp/app_id)"
59-
export APP_ID
60-
export CLIENT_KEY=/tmp/key.pem
61-
./scripts/release-notes/gen_gh_releases.sh rhocp --ci-job-branch "${BRANCH}" publish ${DRY_RUN} --input /tmp/releases.json
56+
# gen_gh_release.sh rhocp is expected to only run against branches synced the main to not duplicate efforts.
57+
# For branches synced with main see https://github.com/openshift/microshift/issues/1239.
58+
# Otherwise, it exits with 0 and does not create /tmp/releases.json file.
59+
# We need to skip creation of GH releases and proceed to common_versions.sh update.
60+
if [ -f /tmp/releases.json ]; then
61+
cat /tmp/releases.json
62+
63+
APP_ID="\$(cat /tmp/app_id)"
64+
export APP_ID
65+
export CLIENT_KEY=/tmp/key.pem
66+
./scripts/release-notes/gen_gh_releases.sh rhocp --ci-job-branch "${BRANCH}" publish ${DRY_RUN} --input /tmp/releases.json
67+
fi
6268
6369
./scripts/pyutils/create-venv.sh
6470
source ./_output/pyutils/bin/activate
6571
export KEY="/tmp/key.pem"
66-
xy="\$(echo "${BRANCH}" | awk -F'[-.]' '{ print \$3 }')"
72+
73+
# Script is release agnostic but it clones specific branch, so it needs to provide correct argument based on the release.
74+
# 4.22 and older: xy=MINOR version
75+
# 5.0 and newer: xy=MAJOR.MINOR version
76+
if python ./test/bin/pyutils/generate_common_versions.py --help | grep -q "The minor version number"; then
77+
xy="\$(echo "${BRANCH}" | awk -F'[-.]' '{ print \$3 }')"
78+
else
79+
xy="\$(echo "${BRANCH}" | awk -F'-' '{ print \$2 }')"
80+
fi
6781
python ./test/bin/pyutils/generate_common_versions.py "\${xy}" --create-pr ${DRY_RUN}
6882
EOF
6983
chmod +x /tmp/run.sh

0 commit comments

Comments
 (0)