Skip to content

Commit 085b789

Browse files
author
Andras Fekete
committed
Update buildAndPush script
1 parent 63ec8fe commit 085b789

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

Docker/buildAndPush.sh

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,37 @@ docker build -t wolfssl/wolfssl-builder:${CUR_DATE} ${DOCKER_BUILD_OPTIONS} "${W
1818
docker tag wolfssl/testing-cross-compiler:${CUR_DATE} wolfssl/testing-cross-compiler:latest
1919

2020
if [ $? -eq 0 ]; then
21-
echo "Pushing containers to DockerHub"
22-
docker push wolfssl/wolfssl-builder:${CUR_DATE} && docker push wolfssl/wolfssl-builder:latest && \
23-
docker push wolfssl/testing-cross-compiler:${CUR_DATE} && docker push wolfssl/testing-cross-compiler:latest
21+
echo "Push containers to DockerHub [y/N]? "
22+
read val
23+
if [ "$val" = "y" ]; then
24+
docker push wolfssl/wolfssl-builder:${CUR_DATE} && docker push wolfssl/wolfssl-builder:latest && \
25+
docker push wolfssl/testing-cross-compiler:${CUR_DATE} && docker push wolfssl/testing-cross-compiler:latest
26+
if [ $? -ne 0 ]; then
27+
echo "Warning: push failed. Continuing"
28+
((NUM_FAILURES++))
29+
fi
30+
fi
2431
else
2532
echo "Warning: Build wolfssl/wolfssl-builder failed. Continuing"
2633
((NUM_FAILURES++))
2734
fi
2835

2936
echo "Building wolfssl/wolfCLU:${CUR_DATE}"
30-
docker buildx build --pull --push --build-arg DUMMY=${CUR_DATE} -t wolfssl/wolfclu:${CUR_DATE} --platform=linux/amd64,linux/arm64,linux/arm/v7 "${WOLFSSL_DIR}/Docker/wolfCLU" && \
31-
docker buildx build --pull --push --build-arg DUMMY=${CUR_DATE} -t wolfssl/wolfclu:latest --platform=linux/amd64,linux/arm64,linux/arm/v7 "${WOLFSSL_DIR}/Docker/wolfCLU"
32-
if [ $? -ne 0 ]; then
37+
DOCKER_ARGS="--pull --build-arg DUMMY=${CUR_DATE} --platform=linux/amd64,linux/arm64,linux/arm/v7 ${WOLFSSL_DIR}/Docker/wolfCLU"
38+
docker buildx build -t wolfssl/wolfclu:${CUR_DATE} ${DOCKER_ARGS} && \
39+
docker buildx build -t wolfssl/wolfclu:latest ${DOCKER_ARGS}
40+
if [ $? -eq 0 ]; then
41+
echo "Push containers to DockerHub [y/N]? "
42+
read val
43+
if [ "$val" = "y" ]; then
44+
docker buildx build ${DOCKER_ARGS} --push -t wolfssl/wolfclu:${CUR_DATE} && \
45+
docker buildx build ${DOCKER_ARGS} --push -t wolfssl/wolfclu:latest
46+
if [ $? -ne 0 ]; then
47+
echo "Warning: push failed. Continuing"
48+
((NUM_FAILURES++))
49+
fi
50+
fi
51+
else
3352
echo "Warning: Build wolfssl/wolfclu failed. Continuing"
3453
((NUM_FAILURES++))
3554
fi

0 commit comments

Comments
 (0)