This commit is contained in:
Oscar Krause
2022-12-21 11:06:09 +01:00
parent 4184731571
commit c5b6c79d1c
3 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ build:
- if: $CI_COMMIT_BRANCH
tags: [ docker ]
before_script:
- echo "COMMIT=`git rev-parse HEAD`" >> version.env
- echo "COMMIT=${CI_COMMIT_SHA}" >> version.env # COMMIT=`git rev-parse HEAD`
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build . --tag ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_BUILD_REF_NAME}:${CI_BUILD_REF}
@@ -25,6 +25,7 @@ deploy:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
- echo "COMMIT=${CI_COMMIT_SHA}" >> version.env
- source version.env
- Building docker image for commit "${COMMIT}" with version "${VERSION}"
script: