mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
kaniko seems to have a different shell that doesnt support local command, just use export then
This commit is contained in:
parent
b3fd521d00
commit
dba817ba57
@ -23,8 +23,8 @@ docker:
|
||||
- export container=docker
|
||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- |
|
||||
source "$CI_PROJECT_DIR/.gitlab/scripts/util.sh"
|
||||
publishdockertag PUBLISH_DOCKER_TAG
|
||||
source "$CI_PROJECT_DIR/.gitlab/scripts/util.sh";
|
||||
publishdockertag;
|
||||
if [ "${PUBLISH_DOCKER_TAG}" != "" ]; then
|
||||
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${PUBLISH_DOCKER_TAG}"
|
||||
fi
|
||||
|
@ -6,24 +6,23 @@
|
||||
### master => "master"
|
||||
### else => ""
|
||||
publishdockertag () {
|
||||
# this stores the result in a variable defined by the caller
|
||||
local -n VAR=$1
|
||||
VAR="";
|
||||
# this stores the result in PUBLISH_DOCKER_TAG
|
||||
export PUBLISH_DOCKER_TAG="";
|
||||
if [[ "${CI_COMMIT_TAG}" =~ ${TAG_REGEX} ]]; then
|
||||
VAR="${CI_COMMIT_TAG}";
|
||||
export PUBLISH_DOCKER_TAG="${CI_COMMIT_TAG}";
|
||||
return 0;
|
||||
fi
|
||||
if [[ -z "${SCHEDULE_CADENCE}" && ${CI_PIPELINE_SOURCE} == "schedule" ]]; then
|
||||
# sanitize check
|
||||
if [[ "${SCHEDULE_CADENCE}" =~ ${TAG_REGEX} ]]; then
|
||||
VAR="invalid_cadence";
|
||||
export PUBLISH_DOCKER_TAG="invalid_cadence";
|
||||
else
|
||||
VAR="${SCHEDULE_CADENCE}";
|
||||
export PUBLISH_DOCKER_TAG="${SCHEDULE_CADENCE}";
|
||||
fi
|
||||
return 0;
|
||||
fi
|
||||
if [[ ${CI_COMMIT_BRANCH} == ${CI_DEFAULT_BRANCH} ]]; then
|
||||
VAR="master";
|
||||
export PUBLISH_DOCKER_TAG="master";
|
||||
return 0;
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user