Skip to content

Commit ffdd80f

Browse files
committed
wip
1 parent 95ccced commit ffdd80f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ ci_script_prologue
88
DRY_RUN=""
99
if [[ "$JOB_NAME" == rehearse* ]]; then
1010
echo "INFO: \$JOB_NAME starts with rehearse - running in DRY RUN mode"
11-
DRY_RUN="-n"
11+
DRY_RUN="--dry-run"
1212
fi
1313

1414
if [ -z ${CLONEREFS_OPTIONS+x} ]; then
1515
# Without `src` build, there's no CLONEREFS_OPTIONS, but it can be assembled from $JOB_SPEC
1616
CLONEREFS_OPTIONS=$(echo "${JOB_SPEC}" | jq '{"src_root": "/go", "log":"/dev/null", "git_user_name": "ci-robot", "git_user_email": "[email protected]", "fail": true, "refs": [(select(.refs) | .refs), try(.extra_refs[])]}')
1717
export CLONEREFS_OPTIONS
1818
fi
19+
env
1920
BRANCH=$(echo "${CLONEREFS_OPTIONS}" | jq -r '.refs[] | select(.repo=="microshift") | .base_ref')
2021
if [[ "${BRANCH}" == "" ]]; then
2122
echo "BRANCH turned out to be empty - investigate"
@@ -33,7 +34,7 @@ download_microshift_scripts
3334
"\${DNF_RETRY}" "install" "git"
3435
3536
# Clone the repository directly. Clonerefs is too efficient and skips commits on release branches absent from main.
36-
git clone https://github.com/openshift/microshift.git
37+
git clone https://github.com/openshift/microshift.git --branch "${BRANCH}"
3738
cd ~/microshift
3839
3940
git config user.name "ci-robot"
@@ -46,6 +47,9 @@ sudo subscription-manager config --rhsm.manage_repos=1
4647
# Enabling the most recent RHOCP can break DNF because it cannot be accessed yet.
4748
sudo subscription-manager repos --disable "rhocp-4.*-for-rhel-9-\$(uname -m)-rpms"
4849
50+
# Create dir as user, following sudo gen_gh_releases.sh script creates venv as root and prevents next command from creating a subdir.
51+
mkdir -p ./_output
52+
4953
# sudo to allowe dnf to update the cache
5054
sudo -E ./scripts/release-notes/gen_gh_releases.sh rhocp --ci-job-branch "${BRANCH}" query --output /tmp/releases.json
5155
@@ -55,6 +59,12 @@ APP_ID="\$(cat /tmp/app_id)"
5559
export APP_ID
5660
export CLIENT_KEY=/tmp/key.pem
5761
./scripts/release-notes/gen_gh_releases.sh rhocp --ci-job-branch "${BRANCH}" publish ${DRY_RUN} --input /tmp/releases.json
62+
63+
./scripts/pyutils/create-venv.sh
64+
source ./_output/pyutils/bin/activate
65+
export KEY="/tmp/key.pem"
66+
xy="\$(echo "${BRANCH}" | awk -F'[-.]' '{ print \$3 }')"
67+
python ./test/bin/pyutils/generate_common_versions.py "\${xy}" --create-pr ${DRY_RUN}
5868
EOF
5969
chmod +x /tmp/run.sh
6070

0 commit comments

Comments
 (0)