@@ -6,80 +6,37 @@ set -Eeuo pipefail
6
6
# "$0" 4.12 ~/code/src/github.com/openshift/release
7
7
8
8
NEW_VERSION=" $1 "
9
- PERIODICS_DIR=" ${2} /ci-operator/config/shiftstack/shiftstack- ci"
9
+ PERIODICS_DIR=" ${2} /ci-operator/config/shiftstack/ci"
10
10
11
11
OLD_VERSION=" 4.$(( ${NEW_VERSION# 4.} - 1 )) "
12
12
OLD_OLD_VERSION=" 4.$(( ${OLD_VERSION# 4.} - 1 )) "
13
- OUT_OF_SUPPORT_VERSION=" 4.$(( ${OLD_VERSION# 4.} - 5 )) "
14
13
15
- OLD_PERIODIC=" ${PERIODICS_DIR} /shiftstack-shiftstack-ci-main__periodic-${OLD_VERSION} .yaml"
16
- NEW_PERIODIC=" ${PERIODICS_DIR} /shiftstack-shiftstack-ci-main__periodic-${NEW_VERSION} .yaml"
17
- OUT_OF_SUPPORT_PERIODIC=" ${PERIODICS_DIR} /shiftstack-shiftstack-ci-main__periodic-${OUT_OF_SUPPORT_VERSION} .yaml"
14
+ OLD_PERIODIC=" ${PERIODICS_DIR} /shiftstack-ci-release-${OLD_VERSION} .yaml"
15
+ NEW_PERIODIC=" ${PERIODICS_DIR} /shiftstack-ci-release-${NEW_VERSION} .yaml"
18
16
19
- OLD_UPGRADE_PERIODIC =" ${PERIODICS_DIR} /shiftstack-shiftstack- ci-main__periodic -${OLD_VERSION} -upgrade-from-stable- ${OLD_OLD_VERSION} .yaml"
20
- NEW_UPGRADE_PERIODIC =" ${PERIODICS_DIR} /shiftstack-shiftstack- ci-main__periodic -${NEW_VERSION} -upgrade-from-stable- ${OLD_VERSION} .yaml"
17
+ OLD_TP_PERIODIC =" ${PERIODICS_DIR} /shiftstack-ci-release -${OLD_VERSION} __techpreview .yaml"
18
+ NEW_TP_PERIODIC =" ${PERIODICS_DIR} /shiftstack-ci-release -${NEW_VERSION} __techpreview .yaml"
21
19
22
- # Copy-paste "simple install" periodics
23
- # shellcheck disable=SC2016 # Shellcheck appears confused by the proliferation of quotes
24
- yq --yaml-output ' .
25
- # Replace the old version in base images (.base_images.*.name)
26
- | ( .base_images[] | select(.name == "' " ${OLD_VERSION} " ' ") | .name ) |= "' " ${NEW_VERSION} " ' "
20
+ OLD_UPGRADE_PERIODIC=" ${PERIODICS_DIR} /shiftstack-ci-release-${OLD_VERSION} __upgrade-from-stable-${OLD_OLD_VERSION} .yaml"
21
+ NEW_UPGRADE_PERIODIC=" ${PERIODICS_DIR} /shiftstack-ci-release-${NEW_VERSION} __upgrade-from-stable-${OLD_VERSION} .yaml"
27
22
28
- # Replace the old version in release images (.releases.{initial,latest}.{prerelease,candidate}.version)
29
- | ( .releases[][] | select(.version == " ' " ${OLD_VERSION} " ' ") | .version ) |= " ' " ${NEW_VERSION} " ' "
23
+ # Pointing development branch to `ci` stream, while maintenance branches point
24
+ # to `nightly` to reduce the noise
30
25
31
- # Ensure that the release stream is set to "ci"
32
- | ( .releases[][] | select(.stream == "nightly") | .stream ) |= "ci"
26
+ cp " ${OLD_PERIODIC} " " ${NEW_PERIODIC} "
27
+ sed -i " s/${OLD_VERSION} /${NEW_VERSION} /" " ${NEW_PERIODIC} "
28
+ sed -i " s/stream: nightly/stream: ci/" " ${NEW_PERIODIC} "
29
+ sed -i " s/stream: ci/stream: nightly/" " ${OLD_PERIODIC} "
33
30
34
- # Replace the version in the footer generated metadata, just to be on the safe side
35
- # (although it will probably be rewritten when running `make update`
36
- | .zz_generated_metadata.variant="periodic-' " ${NEW_VERSION} " ' "
31
+ cp " ${OLD_TP_PERIODIC} " " ${NEW_TP_PERIODIC} "
32
+ sed -i " s/${OLD_VERSION} /${NEW_VERSION} /" " ${NEW_TP_PERIODIC} "
33
+ sed -i " s/stream: nightly/stream: ci/" " ${NEW_TP_PERIODIC} "
34
+ sed -i " s/stream: ci/stream: nightly/" " ${OLD_TP_PERIODIC} "
37
35
38
- ' " $OLD_PERIODIC " > " $NEW_PERIODIC "
39
-
40
- # Copy-paste "upgrade" periodics
41
- # shellcheck disable=SC2016 # Shellcheck appears confused by the proliferation of quotes
42
- yq --yaml-output ' .
43
- # Replace the old version in base images (.base_images.*.name)
44
- | ( .base_images[] | select(.name == "' " ${OLD_VERSION} " ' ") | .name ) |= "' " ${NEW_VERSION} " ' "
45
-
46
- # Replace the previous starting version in base images (.base_images.*.name)
47
- | ( .base_images[] | select(.name == "' " ${OLD_OLD_VERSION} " ' ") | .name ) |= "' " ${OLD_VERSION} " ' "
48
-
49
- # Replace the old version in release images (.releases.*.*.version)
50
- | ( .releases[][] | select(.version == "' " ${OLD_VERSION} " ' ") | .version ) |= "' " ${NEW_VERSION} " ' "
51
-
52
- # Replace the previous starting version release images (.releases.*.*.version_bounds.lower)
53
- | ( .releases[][] | select(.version_bounds != null) | .version_bounds.lower ) |= "' " ${OLD_VERSION} .0-0" ' "
54
-
55
- # Replace the old version release images (.releases.*.*.version_bounds.upper)
56
- | ( .releases[][] | select(.version_bounds != null) | .version_bounds.upper ) |= "' " ${NEW_VERSION} .0-0" ' "
57
-
58
- # Replace the version in the footer generated metadata, just to be on the safe side
59
- # (although it will probably be rewritten when running `make update`
60
- | .zz_generated_metadata.variant="periodic-' " ${NEW_VERSION} " ' -upgrade-from-stable-' " ${OLD_VERSION} " ' "
61
-
62
- ' " $OLD_UPGRADE_PERIODIC " > " $NEW_UPGRADE_PERIODIC "
63
-
64
- # Set all intervals to 72h for the branch that is not the newest any more
65
- yq --yaml-output --in-place ' .
66
- # Set the release stream to "nightly" to reduce noise on maintenance branches
67
- | ( .releases[][] | select(.stream == "ci") | .stream ) |= "nightly"
68
-
69
- # Set a conveniently long interval to all tests in the old periodics
70
- | del(.tests[].interval)
71
- | del(.tests[].cron)
72
- | .tests[].minimum_interval |= "72h"
73
-
74
- ' " $OLD_PERIODIC "
75
-
76
- # Set maximum interval for branch that fell off support
77
- yq --yaml-output --in-place ' .
78
- # Set a conveniently long interval to all tests in the old periodics
79
- | del(.tests[].interval)
80
- | del(.tests[].cron)
81
- | .tests[].minimum_interval |= "8766h"
82
-
83
- ' " $OUT_OF_SUPPORT_PERIODIC "
36
+ cp " ${OLD_UPGRADE_PERIODIC} " " ${NEW_UPGRADE_PERIODIC} "
37
+ sed -i " s/${OLD_VERSION} /${NEW_VERSION} /" " ${NEW_UPGRADE_PERIODIC} "
38
+ sed -i " s/${OLD_OLD_VERSION} /${OLD_VERSION} /" " ${NEW_UPGRADE_PERIODIC} "
39
+ sed -i " s/stream: nightly/stream: ci/" " ${NEW_UPGRADE_PERIODIC} "
40
+ sed -i " s/stream: ci/stream: nightly/" " ${OLD_UPGRADE_PERIODIC} "
84
41
85
42
echo " Done. Now go to '${2} ' and run a good 'make update' before pushing the patch."
0 commit comments