Skip to content

Commit 0c87cf7

Browse files
Merge pull request nodejs#917 from nodejs/enhance-update.sh
Add update.sh -t option to update .travis.yml only
2 parents d6b033a + fe5a062 commit 0c87cf7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

update.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,28 @@ function usage() {
1717
- update.sh 8 slim,stretch # Update only slim and stretch variants for version 8
1818
- update.sh -s 8 slim,stretch # Update only slim and stretch variants for version 8, skip updating Alpine and Yarn
1919
- update.sh . alpine # Update the alpine variant for all versions
20+
- update.sh -t # Update .travis.yml only
2021
2122
OPTIONS:
2223
-s Security update; skip updating the yarn and alpine versions.
24+
-t Travis CI config update only
2325
-h Show this message
2426
2527
EOF
2628
}
2729

2830
SKIP=false
29-
while getopts "sh" opt; do
31+
TRAVIS_CI_ONLY=false
32+
while getopts "sth" opt; do
3033
case "${opt}" in
3134
s)
3235
SKIP=true
3336
shift
3437
;;
38+
t)
39+
TRAVIS_CI_ONLY=true
40+
shift
41+
;;
3542
h)
3643
usage
3744
exit
@@ -196,14 +203,15 @@ for version in "${versions[@]}"; do
196203
baseuri=$(get_config "${parentpath}" "baseuri")
197204
update_version=$(in_versions_to_update "${version}")
198205

199-
[ "${update_version}" -eq 0 ] && info "Updating version ${version}..."
206+
[ "${update_version}" -eq 0 ] && [ true != "$TRAVIS_CI_ONLY" ] && info "Updating version ${version}..."
200207

201208
# Get supported variants according the target architecture
202209
# See details in function.sh
203210
IFS=' ' read -ra variants <<< "$(get_variants "${parentpath}")"
204211

205212
if [ -f "${version}/Dockerfile" ]; then
206213
add_stage "${baseuri}" "${version}" "default"
214+
[ true = "$TRAVIS_CI_ONLY" ] && continue
207215

208216
if [ "${update_version}" -eq 0 ]; then
209217
update_node_version "${baseuri}" "${versionnum}" "${parentpath}/Dockerfile.template" "${version}/Dockerfile" &
@@ -214,6 +222,7 @@ for version in "${versions[@]}"; do
214222
# Skip non-docker directories
215223
[ -f "${version}/${variant}/Dockerfile" ] || continue
216224
add_stage "${baseuri}" "${version}" "${variant}"
225+
[ true = "$TRAVIS_CI_ONLY" ] && continue
217226

218227
update_variant=$(in_variants_to_update "${variant}")
219228

0 commit comments

Comments
 (0)