MAVEN_OPTIONS="$(echo --show-version \
--batch-mode \
-Djenkins \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
+ "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer"\
+".Slf4jMavenTransferListener=warn" \
-Dmaven.repo.local=/tmp/r \
-Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
echo "$MAVEN_OPTIONS"
# Activates the lftools virtualenv
lftools_activate() {
- echo "WARNING: lftools_activate should no longer be used and will be removed in a future release."
+ echo "WARNING: lftools_activate should no longer be used"\
+ "and will be removed in a future release."
virtualenv --quiet "/tmp/v/lftools"
set +u # Ignore unbound variables in activate
# shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
docker --version
echo "Building image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG"
cd "$DOCKER_ROOT"
-# DOCKER_IMAGE_TAG variable gets constructed after lf-docker-get-container-tag builder step
-# is executed. It constructs the image name and the appropriate tag in the same varaiable.
-docker_build_command="docker build ${DOCKER_ARGS:-} -t "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" ."
+# DOCKER_IMAGE_TAG variable gets constructed after lf-docker-get-container-tag
+# builder step is executed. It constructs the image name and the appropriate
+# tag in the same varaiable.
+docker_build_command="docker build ${DOCKER_ARGS:-} \
+ -t "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG" ."
echo "$docker_build_command"
eval "$docker_build_command" | tee "$WORKSPACE/docker_build_log.txt"
echo "---> docker-build.sh ends"
# Ensure we fail the job if any steps fail
set -eu -o pipefail
-#Check if current version less than desired version
-version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
+# Check if current version less than desired version
+version_lt() {
+ test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1";
+}
# Execute the credential lookup and set
set_creds() {
set -ue -o pipefail
docker --version
echo "Pushing image: $CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG"
-docker_push_command="docker push "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG""
+docker_push_command="docker push" \
+ "$CONTAINER_PUSH_REGISTRY/$DOCKER_NAME:$DOCKER_IMAGE_TAG"
echo "$docker_push_command"
eval "$docker_push_command"
echo "---> docker-push.sh ends"
case $mode in
lock)
echo "Locking branch: $GERRIT_BRANCH"
- git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.exclusiveGroupPermissions" "submit"
- git config -f project.config "access.refs/heads/${GERRIT_BRANCH}.submit" "block group Registered Users"
+ git config -f project.config \
+ "access.refs/heads/${GERRIT_BRANCH}.exclusiveGroupPermissions" \
+ "submit"
+ git config -f project.config \
+ "access.refs/heads/${GERRIT_BRANCH}.submit" \
+ "block group Registered Users"
git commit -asm "Lock branch $GERRIT_BRANCH"
;;
unlock)
echo "Unlocking branch: $GERRIT_BRANCH"
- git config -f project.config --remove-section "access.refs/heads/${GERRIT_BRANCH}" || true
+ git config -f project.config --remove-section \
+ "access.refs/heads/${GERRIT_BRANCH}" || true
git commit -asm "Unlock branch $GERRIT_BRANCH"
;;