fix script

node-20
Elad Bar 2023-09-27 09:13:19 +03:00
parent a2af613191
commit e585fe9d81
1 changed files with 14 additions and 19 deletions

View File

@ -218,6 +218,10 @@ docker-nvidia-no-db-build:
# Use the official docker image. # Use the official docker image.
image: docker:latest image: docker:latest
stage: build stage: build
variables:
ARCH_TYPE: "nvidia"
INCLUDE_DB: false
DOCKER_FILE: "Dockerfile.nvidia"
services: services:
- docker:dind - docker:dind
before_script: before_script:
@ -226,31 +230,22 @@ docker-nvidia-no-db-build:
# All other branches are tagged with the escaped branch name (commit ref slug) # All other branches are tagged with the escaped branch name (commit ref slug)
script: script:
- | - |
arch="nvidia" ; export BRANCH_PREFIX="" ;
branch="" ; export NO_DB_SUFIX="" ;
no_db=true ;
no_db_tag = "" ;
docker_file_ext="" ;
if [[ "${arch}" != "" ]]; then
docker_file_ext=".${arch}"
fi
if [[ "$CI_COMMIT_BRANCH" != "$CI_DEFAULT_BRANCH" ]]; then if [[ "$CI_COMMIT_BRANCH" != "$CI_DEFAULT_BRANCH" ]]; then
branch="${CI_COMMIT_REF_SLUG}-" export BRANCH_PREFIX="${CI_COMMIT_REF_SLUG}-" ;
fi fi
if [[ "${no_db}" == "true" ]]; then if [[ "${INCLUDE_DB}" == "true" ]]; then
no_db_tag="-no-db" export NO_DB_SUFIX="-no-db" ;
fi fi
tag=":${branch}${arch}${no_db_tag}" ; export IMAGE_NAME="$CI_REGISTRY_IMAGE:${BRANCH_PREFIX}${ARCH_TYPE}${NO_DB_SUFIX}" ;
echo "Running on branch '${CI_COMMIT_BRANCH}', Image: ${IMAGE_NAME}" ;
image_tag="$CI_REGISTRY_IMAGE${tag}" ; - docker build --pull --build-arg VAR_EXCLUDE_DB="${INCLUDE_DB}" -t "${IMAGE_NAME}" . -f "${DOCKER_FILE}"
echo "Running on branch '${CI_COMMIT_BRANCH}', Tag: ${tag}, Image: ${image_tag}" ; - docker push "${IMAGE_NAME}"
- docker build --pull --build-arg VAR_EXCLUDE_DB="${no_db}" -t "${image_tag}" . -f "Dockerfile${docker_file_ext}"
- docker push "${image_tag}"
# Run this job in a branch where a Dockerfile exists # Run this job in a branch where a Dockerfile exists
rules: rules:
# - if: $CI_COMMIT_BRANCH != "master" && $CI_COMMIT_BRANCH != "main" && $CI_COMMIT_BRANCH != "dev" # - if: $CI_COMMIT_BRANCH != "master" && $CI_COMMIT_BRANCH != "main" && $CI_COMMIT_BRANCH != "dev"