[gjs/wip/ptomato/fix-docker] CI: Quote variables consistently in bash scripts
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/wip/ptomato/fix-docker] CI: Quote variables consistently in bash scripts
- Date: Sat, 21 Sep 2019 20:06:15 +0000 (UTC)
commit 46ac7db02e42e7d0e10f390a34b40275c72a5394
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Sep 21 12:57:21 2019 -0700
CI: Quote variables consistently in bash scripts
Not sure if this contributed to the problem, but I did see on Stack
Overflow that particularly `-v $(pwd):/foo` would fail without quotes if
the working directory had any spaces in it.
Unreviewed, pushing to fix build.
.gitlab-ci.yml | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 14cf480a..a5ee0c90 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -373,17 +373,17 @@ zeal_11:
- *CI_header
# Where the real magic happens
- - docker run --name $NAME -v $(pwd):/on-host -e OS=$IMAGE -e BUILD_OPTS=$BUILD_OPTS -e CC=gcc -e
MOZJS_BRANCH=$MOZJS_BRANCH $IMAGE bash -e -c "cd /on-host && test/ci-images.sh"
- - docker commit $NAME "$CI_REGISTRY_IMAGE:$NAME"
+ - docker run --name "$NAME" -v "$(pwd):/on-host" -e OS="$IMAGE" -e BUILD_OPTS="$BUILD_OPTS" -e CC=gcc -e
MOZJS_BRANCH="$MOZJS_BRANCH" "$IMAGE" bash -e -c "cd /on-host && test/ci-images.sh"
+ - docker commit "$NAME" "$CI_REGISTRY_IMAGE:$NAME"
# Prepare to publish
- - docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_$NAME"
+ - docker tag "$CI_REGISTRY_IMAGE:$NAME" "$CI_REGISTRY_IMAGE:job-${CI_JOB_ID}_$NAME"
- docker images
- - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
+ - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
# Publish (if running on a schedule)
- |
- if [[ "${CI_PIPELINE_SOURCE}" == "schedule" ]]; then
+ if [[ "$CI_PIPELINE_SOURCE" == "schedule" ]]; then
docker push "$CI_REGISTRY_IMAGE"
fi
@@ -396,11 +396,11 @@ alpine.cpplint:
# Overrides the script from create_docker_image above
- *CI_header
- docker build -f test/extra/Dockerfile.alpine.cpplint -t "$CI_REGISTRY_IMAGE:alpine.cpplint" .
- - docker tag "$CI_REGISTRY_IMAGE:alpine.cpplint" "$CI_REGISTRY_IMAGE:job-"$CI_JOB_ID"_alpine.cpplint"
+ - docker tag "$CI_REGISTRY_IMAGE:alpine.cpplint" "$CI_REGISTRY_IMAGE:job-${CI_JOB_ID}_alpine.cpplint"
- docker images
- - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
+ - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- |
- if [[ "${CI_PIPELINE_SOURCE}" == "schedule" ]]; then
+ if [[ "$CI_PIPELINE_SOURCE" == "schedule" ]]; then
docker push "$CI_REGISTRY_IMAGE"
fi
- *CI_footer
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]