Skip to content
Snippets Groups Projects
Commit 58be591e authored by Robiel Elias Redie's avatar Robiel Elias Redie
Browse files

gitlab ci yaml updated

parent 9738317f
Branches
Tags v0.2.4
No related merge requests found
Pipeline #131290 failed
.build_container_image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: ['']
variables:
DOCKERFILE_LOCATION: 'unset'
CONTAINER_NAME: 'unset'
TAG_NAME: 'unset'
script:
- mkdir -p /kaniko/.docker
- echo "DOCKERFILE_LOCATION" $DOCKERFILE_LOCATION
- echo "CONTAINER_NAME" $CONTAINER_NAME
- echo "TAG_NAME" $TAG_NAME
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- |
if [[ "$CREATE_LATEST_TAG" == "true" ]];
then
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $DOCKERFILE_LOCATION --destination $CI_REGISTRY_IMAGE/$CONTAINER_NAME:$TAG_NAME --destination $CI_REGISTRY_IMAGE/$CONTAINER_NAME:latest
else
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $DOCKERFILE_LOCATION --destination $CI_REGISTRY_IMAGE/$CONTAINER_NAME:$TAG_NAME;
fi
stages:
- build stages:
- test - print:readme
- commit:dev_build
- commit:test
- commit:code_analysis
- commit:verify_analysis
- commit:release_build
- staging:deploy
- production:deploy
build_application:
stage: build ##################################################
script: # Tasks of "commit"- Stage
echo " This will be the gitlab file for building the pipeline that includes 3 stages. And these will be build, test and deploy" ##################################################
\ No newline at end of file
variables:
DEVELOPMENT_CONTAINER_NAME: 'development-container'
DEVELOPMENT_CONTAINER_TAG: "${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}" #eindeutiger Tag durch "SHA" Hash
RELEASE_CONTAINER_NAME: 'release-container'
RELEASE_CONTAINER_TAG: "${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}" #eindeutiger Tag durch "SHA" Hash
# build development container image
create_development_container_image:
stage: commit:dev_build
extends:
- .build_container_image
variables:
DOCKERFILE_LOCATION: $CI_PROJECT_DIR/app/Dockerfile
CONTAINER_NAME: $DEVELOPMENT_CONTAINER_NAME
TAG_NAME: $DEVELOPMENT_CONTAINER_TAG
CREATE_LATEST_TAG: 'true'
only:
- branches
- merge_requests
- main
except:
- schedules
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment