Skip to content

Commit 34d0151

Browse files
committed
feat: add ACM fast-forwarding periodic
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
1 parent 63cc142 commit 34d0151

9 files changed

Lines changed: 234 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
approvers:
2+
- dhaiducek
3+
- gparvin
4+
5+
reviewers:
6+
- dhaiducek
7+
- gparvin
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
build_root:
2+
image_stream_tag:
3+
name: builder
4+
namespace: stolostron
5+
tag: go1.25-linux
6+
resources:
7+
'*':
8+
requests:
9+
cpu: 100m
10+
memory: 100Mi
11+
tests:
12+
- as: fast-forward
13+
interval: 2h
14+
steps:
15+
env:
16+
DESTINATION_VERSIONS: 2.17 5.0
17+
REPO_MAP_PATH: acm-config/product/component-registry.yaml
18+
tests:
19+
- from: src
20+
workflow: ocm-ci-fastforward-multiple
21+
zz_generated_metadata:
22+
branch: acm-infra-main
23+
org: stolostron
24+
repo: acm-infra
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
periodics:
2+
- agent: kubernetes
3+
cluster: build01
4+
decorate: true
5+
decoration_config:
6+
skip_cloning: true
7+
extra_refs:
8+
- base_ref: acm-infra-main
9+
org: stolostron
10+
repo: acm-infra
11+
interval: 2h
12+
labels:
13+
ci.openshift.io/generator: prowgen
14+
pj-rehearse.openshift.io/can-be-rehearsed: "true"
15+
name: periodic-ci-stolostron-acm-infra-acm-infra-main-fast-forward
16+
spec:
17+
containers:
18+
- args:
19+
- --gcs-upload-secret=/secrets/gcs/service-account.json
20+
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
21+
- --lease-server-credentials-file=/etc/boskos/credentials
22+
- --report-credentials-file=/etc/report/credentials
23+
- --target=fast-forward
24+
command:
25+
- ci-operator
26+
env:
27+
- name: HTTP_SERVER_IP
28+
valueFrom:
29+
fieldRef:
30+
fieldPath: status.podIP
31+
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
32+
imagePullPolicy: Always
33+
name: ""
34+
ports:
35+
- containerPort: 8080
36+
name: http
37+
resources:
38+
requests:
39+
cpu: 10m
40+
volumeMounts:
41+
- mountPath: /etc/boskos
42+
name: boskos
43+
readOnly: true
44+
- mountPath: /secrets/gcs
45+
name: gcs-credentials
46+
readOnly: true
47+
- mountPath: /secrets/manifest-tool
48+
name: manifest-tool-local-pusher
49+
readOnly: true
50+
- mountPath: /etc/pull-secret
51+
name: pull-secret
52+
readOnly: true
53+
- mountPath: /etc/report
54+
name: result-aggregator
55+
readOnly: true
56+
serviceAccountName: ci-operator
57+
volumes:
58+
- name: boskos
59+
secret:
60+
items:
61+
- key: credentials
62+
path: credentials
63+
secretName: boskos-credentials
64+
- name: manifest-tool-local-pusher
65+
secret:
66+
secretName: manifest-tool-local-pusher
67+
- name: pull-secret
68+
secret:
69+
secretName: registry-pull-credentials
70+
- name: result-aggregator
71+
secret:
72+
secretName: result-aggregator
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../OWNERS
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
3+
exit_code=0
4+
5+
echo "Fast-forward workflow inputs:
6+
* REPO_MAP_PATH: ${REPO_MAP_PATH}
7+
* DESTINATION_VERSIONS: ${DESTINATION_VERSIONS}
8+
"
9+
10+
if [[ ! -f "${REPO_MAP_PATH}" ]]; then
11+
echo "ERROR: REPO_MAP_PATH '${REPO_MAP_PATH}' not found"
12+
exit 1
13+
fi
14+
15+
if [[ -z "${DESTINATION_VERSIONS}" ]]; then
16+
echo "ERROR: DESTINATION_VERSIONS may not be empty"
17+
exit 1
18+
fi
19+
20+
for version in ${DESTINATION_VERSIONS}; do
21+
if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+$ ]]; then
22+
echo "ERROR: Version '$version' is not in X.Y format"
23+
exit 1
24+
fi
25+
done
26+
27+
echo "INFO: Fast-forwarding to version: ${version}"
28+
for product in mce acm; do
29+
component_repos=$(yq '.components[] |
30+
select(.bundle == "'"${product}-operator-bundle"'" and
31+
.repository == "https://github.com/stolostron/*").repository' "${REPO_MAP_PATH}")
32+
for repo in ${component_repos}; do
33+
owner_repo=${repo#https://github.com/}
34+
echo "INFO: Handling ${owner_repo}"
35+
# owner=${owner_repo%/*}
36+
repo=${owner_repo#*/}
37+
branch_prefix="release-${version}"
38+
if [[ ${product} == "mce" ]]; then
39+
branch_prefix="backplane-${version}"
40+
fi
41+
echo "INFO: Using branch prefix: ${branch_prefix}"
42+
for version in ${DESTINATION_VERSIONS}; do
43+
branch="${branch_prefix}-${version}"
44+
echo "INFO: Fast-forwarding ${owner_repo} to branch: ${branch}"
45+
# log_file="${ARTIFACT_DIR}/fastforward-${owner_repo}-${branch}.log"
46+
# REPO_OWNER=${owner} \
47+
# REPO_NAME=${repo} \
48+
# SOURCE_BRANCH=main \
49+
# DESTINATION_BRANCH=${branch} \
50+
# ../fastforward/ocm-ci-fastforward-commands.sh >"${log_file}" 2>&1 ||
51+
# {
52+
# exit_code=$?
53+
# echo "ERROR: Failed to fast-forward ${owner_repo} to branch: ${branch}"
54+
# echo "Logs:"
55+
# sed 's/^/ /' "${log_file}"
56+
# }
57+
done
58+
done
59+
done
60+
61+
exit ${exit_code}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"path": "ocm/ci/fastforward-multiple/ocm-ci-fastforward-multiple-ref.yaml",
3+
"owners": {
4+
"approvers": [
5+
"mark-nc",
6+
"MacdonEm",
7+
"smithbw88",
8+
"eemurphy"
9+
]
10+
}
11+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ref:
2+
as: ocm-ci-fastforward-multiple
3+
from_image:
4+
name: builder
5+
namespace: stolostron
6+
tag: go1.25-linux
7+
commands: ocm-ci-fastforward-multiple-commands.sh
8+
resources:
9+
requests:
10+
cpu: 100m
11+
memory: 100Mi
12+
credentials:
13+
- namespace: test-credentials
14+
name: acm-cicd-github
15+
mount_path: /etc/acm-cicd-github
16+
env:
17+
- name: GITHUB_USER
18+
default: "acm-cicd-prow-bot"
19+
documentation: |-
20+
The GitHub user name.
21+
- name: GITHUB_TOKEN_FILE
22+
default: "/etc/acm-cicd-github/token"
23+
documentation: |-
24+
The file that stores the GitHub token. Should match credentials stanza
25+
mount path.
26+
- name: REPO_MAP_PATH
27+
default: ""
28+
documentation: |-
29+
Path to a YAML file containing a component mapping for fast-forwarding as:
30+
.components[{
31+
bundle: <product>-operator-bundle,
32+
repository: https://github.com/<owner>/<repo>
33+
}]
34+
- name: DESTINATION_VERSIONS
35+
default: ""
36+
documentation: |-
37+
The version(s) that you want to fast forward TO.
38+
documentation: |-
39+
This step fast forwards a source branch to a destination branch in a GitHub
40+
repo.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"path": "ocm/ci/fastforward-multiple/ocm-ci-fastforward-multiple-workflow.yaml",
3+
"owners": {
4+
"approvers": [
5+
"mark-nc",
6+
"MacdonEm",
7+
"smithbw88",
8+
"eemurphy"
9+
]
10+
}
11+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
workflow:
2+
as: ocm-ci-fastforward-multiple
3+
steps:
4+
test:
5+
- ref: ocm-ci-fastforward-multiple
6+
documentation: |-
7+
This workflow calls the fastforward workflow for multiple repositories.

0 commit comments

Comments
 (0)