Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ function usage() {

Examples:
- update.sh # Update all images
- update.sh -s # Update all images, skip updating Alpine
- update.sh -s # Update all images, skip updating Alpine if the Musl build isn't available
- update.sh 8,10 # Update all variants of version 8 and 10
- update.sh -s 8 # Update version 8 and variants, skip updating Alpine
- update.sh -s 8 # Update version 8 and variants, skip updating Alpine if the Musl build isn't available
- update.sh 8 alpine # Update only alpine's variants for version 8
- update.sh -s 8 bullseye # Update only bullseye variant for version 8, skip updating Alpine
- update.sh -s 8 bullseye # Update only bullseye variant for version 8, skip updating Alpine if the Musl build isn't available
- update.sh . alpine # Update the alpine variant for all versions

OPTIONS:
Expand All @@ -26,9 +26,11 @@ function usage() {
EOF
}

SKIP_ALPINE=false
while getopts "sh" opt; do
case "${opt}" in
s)
SKIP_ALPINE=true
shift
;;
h)
Expand Down Expand Up @@ -57,7 +59,7 @@ if [ ${#versions[@]} -eq 0 ]; then
fi

# Global variables
# Get architecure and use this as target architecture for docker image
# Get architecture and use this as target architecture for docker image
# See details in function.sh
# TODO: Should be able to specify target architecture manually
arch=$(get_arch)
Expand Down Expand Up @@ -145,11 +147,15 @@ function update_node_version() {
)
if [ -z "$checksum" ]; then
rm -f "${dockerfile}-tmp"
fatal "Failed to fetch checksum for version ${nodeVersion}"
if [ "${SKIP_ALPINE}" = true ]; then
echo "${nodeVersion} is missing the Musl build, but skipping for security release!"
else
fatal "Failed to fetch checksum for version ${nodeVersion}"
fi
else
sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp"
sed -Ei -e "s/CHECKSUM=CHECKSUM_x64/CHECKSUM=\"${checksum}\"/" "${dockerfile}-tmp"
fi
sed -Ei -e "s/(alpine:)0.0/\\1${alpine_version}/" "${dockerfile}-tmp"
sed -Ei -e "s/CHECKSUM=CHECKSUM_x64/CHECKSUM=\"${checksum}\"/" "${dockerfile}-tmp"

elif is_debian "${variant}"; then
sed -Ei -e "s/(buildpack-deps:)name/\\1${variant}/" "${dockerfile}-tmp"
elif is_debian_slim "${variant}"; then
Expand Down