Skip to content

Commit 56200c8

Browse files
committed
Make all local vars lowercase
1 parent 66cea9b commit 56200c8

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

bin/build

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ PATCH_VERSION=
2222
# 0 if the version being build is between the two specified versions. 1 if not.
2323
#######################################
2424
versionBetween() {
25-
local FULL_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
26-
if versionLessThan "$FULL_VERSION" "$1"; then
25+
local full_version="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
26+
if versionLessThan "$full_version" "$1"; then
2727
return 1;
2828
fi
2929

30-
if versionGreaterThan "$FULL_VERSION" "$2"; then
30+
if versionGreaterThan "$full_version" "$2"; then
3131
return 1;
3232
fi
3333

@@ -71,9 +71,9 @@ versionLessThan() {
7171
# 1 the version to assert
7272
#######################################
7373
assertVersionAtLeast() {
74-
local FULL_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
75-
if versionLessThan "$FULL_VERSION" "$1"; then
76-
out.warn "No further images supported for PHP version $FULL_VERSION. Quitting..."
74+
local full_version="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
75+
if versionLessThan "$full_version" "$1"; then
76+
out.warn "No further images supported for PHP version $full_version. Quitting..."
7777
exit 0
7878
fi
7979
}
@@ -84,36 +84,36 @@ assertVersionAtLeast() {
8484
# Arguments:
8585
# 1 the image to build. Must have a matching .docker file in the root of the project.
8686
# Globals:
87-
# IMAGE the name of the image currently being build
87+
# image the name of the image currently being build
8888
# MAJOR_VERSION the major PHP version to build images for
8989
# MINOR_VERSION the minor PHP version to build images for
9090
# PATCH_VERSION the patch PHP version that was built
9191
#######################################
9292
buildImage() {
93-
IMAGE="$1"
94-
local MAJOR_TAG MINOR_TAG PATCH_TAG LATEST_TAG repo
93+
image="$1"
94+
local major_tag minor_tag patch_tag latest_tag repo
9595

96-
TAG_SUFFIX=$([[ "$IMAGE" == "php" ]] && echo "" || echo "php")
96+
TAG_SUFFIX=$([[ "$image" == "php" ]] && echo "" || echo "php")
9797

98-
MAJOR_TAG="$MAJOR_VERSION"
99-
MINOR_TAG="$MAJOR_VERSION.$MINOR_VERSION"
98+
major_tag="$MAJOR_VERSION"
99+
minor_tag="$MAJOR_VERSION.$MINOR_VERSION"
100100

101-
MAJOR_TAG="$TAG_SUFFIX$MAJOR_VERSION"
102-
MINOR_TAG="$MAJOR_TAG.$MINOR_VERSION"
101+
major_tag="$TAG_SUFFIX$MAJOR_VERSION"
102+
minor_tag="$major_tag.$MINOR_VERSION"
103103

104-
repo="$OWNER/$IMAGE"
104+
repo="$OWNER/$image"
105105

106-
buildMultiArchImage "$IMAGE" "$repo:$MAJOR_TAG"
107-
if [ "$IMAGE" = "php" ]; then
108-
updatePatchVersion "$IMAGE"
106+
buildMultiArchImage "$image" "$repo:$major_tag"
107+
if [ "$image" = "php" ]; then
108+
updatePatchVersion "$image"
109109
fi
110110

111-
PATCH_TAG="$MINOR_TAG.$PATCH_VERSION"
112-
LATEST_TAG="$PATCH_TAG-$(date '+%Y-%m-%d-%H-%M-%S')"
111+
patch_tag="$minor_tag.$PATCH_VERSION"
112+
latest_tag="$patch_tag-$(date '+%Y-%m-%d-%H-%M-%S')"
113113

114-
buildMultiArchImage "$IMAGE" "$repo:$MINOR_TAG"
115-
buildMultiArchImage "$IMAGE" "$repo:$PATCH_TAG"
116-
buildMultiArchImage "$IMAGE" "$repo:$LATEST_TAG"
114+
buildMultiArchImage "$image" "$repo:$minor_tag"
115+
buildMultiArchImage "$image" "$repo:$patch_tag"
116+
buildMultiArchImage "$image" "$repo:$latest_tag"
117117
}
118118

119119
#######################################
@@ -129,18 +129,18 @@ buildImage() {
129129
# MINOR_VERSION the minor PHP version to build images for
130130
#######################################
131131
buildMultiArchImage() {
132-
local IMAGE="$1"
133-
local TAG="$2"
132+
local image="$1"
133+
local tag="$2"
134134

135135
out.info ""
136136
out.info "Building $1 multi-arch image with tag '$2'"
137137
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 -f "$1.docker" \
138-
--build-arg PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION" -t "$TAG" . > "logs/$1.log" 2>&1
139-
out.success "Successfully built & pushed multi-arch image with tag '$TAG'"
138+
--build-arg PHP_VERSION="$MAJOR_VERSION.$MINOR_VERSION" -t "$tag" . > "logs/$1.log" 2>&1
139+
out.success "Successfully built & pushed multi-arch image with tag '$tag'"
140140

141-
log.info "Pulling multi-arch image '$TAG' since buildx does not support loading currently."
141+
log.info "Pulling multi-arch image '$tag' since buildx does not support loading currently."
142142
log.info 'We will likely need this image as the base for the next one.'
143-
docker image pull "$TAG"
143+
docker image pull "$tag"
144144
}
145145

146146
#######################################
@@ -165,9 +165,9 @@ tagImage() {
165165
# PATCH_VERSION the patch PHP version. e.g. 27 for 7.2.27
166166
#######################################
167167
updatePatchVersion() {
168-
local IMAGE="$1"
168+
local image="$1"
169169

170-
PATCH_VERSION=$(docker run --rm "$OWNER/$IMAGE:$MAJOR_VERSION" php -r '
170+
PATCH_VERSION=$(docker run --rm "$OWNER/$image:$MAJOR_VERSION" php -r '
171171
$version = ($dashPos = strpos(PHP_VERSION, "-")) === false ? PHP_VERSION : substr(PHP_VERSION, 0, $dashPos);
172172
echo explode(".", $version)[2];
173173
')

0 commit comments

Comments
 (0)