Skip to content
Snippets Groups Projects
Verified Commit fc9cf899 authored by Stefan Hynek's avatar Stefan Hynek :drooling_face:
Browse files

chore: show env variables

parent d9c7255d
No related branches found
No related tags found
No related merge requests found
Pipeline #343772 passed
This commit is part of merge request !28. Comments created here will be created in the context of that merge request.
...@@ -57,18 +57,19 @@ build container image: ...@@ -57,18 +57,19 @@ build container image:
entrypoint: [""] entrypoint: [""]
script: script:
# use tag for version if not empty; else commit sha # use tag for version if not empty; else commit sha
- "[[ -n ${CI_COMMIT_TAG} ]] && export version=${CI_COMMIT_TAG} || export version=${CI_COMMIT_SHORT_SHA}" - export CI_COMMIT_TAG=1.0.0
- "test -n \"$CI_COMMIT_TAG\" && export version=$CI_COMMIT_TAG || export version=$CI_COMMIT_SHORT_SHA"
- echo $version - echo $version
- mkdir -p /kaniko/.docker # - mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64 | tr -d '\n')\"},\"$harbor_registry\":{\"auth\":\"$HARBOR_ROBOT_TOKEN64\"}}}" > /kaniko/.docker/config.json # - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64 | tr -d '\n')\"},\"$harbor_registry\":{\"auth\":\"$HARBOR_ROBOT_TOKEN64\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor # - /kaniko/executor
--context $CI_PROJECT_DIR # --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile # --dockerfile $CI_PROJECT_DIR/Dockerfile
--build-arg build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ') # --build-arg build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg vcs_ref=${CI_COMMIT_SHORT_SHA} # --build-arg vcs_ref=${CI_COMMIT_SHORT_SHA}
--build-arg version=${version} # --build-arg version=${version}
--destination $CI_REGISTRY_IMAGE/$project_name:$version # --destination $CI_REGISTRY_IMAGE/$project_name:$version
--destination $harbor_registry/$harbor_repo/$project_name:$version # --destination $harbor_registry/$harbor_repo/$project_name:$version
rules: rules:
# prevent job creation on release commits to $CI_DEFAULT_BRANCH # prevent job creation on release commits to $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment