Skip to content
Snippets Groups Projects
Commit b3763550 authored by michael.minelli's avatar michael.minelli
Browse files

CI/CD => Add test release

parent 11be744d
No related branches found
No related tags found
No related merge requests found
Pipeline #26969 canceled
......@@ -6,9 +6,14 @@ variables:
DOCKER_TLS_CERTDIR:
DOCKER_DRIVER: overlay2
DOCKER_REGISTRY: docker.io
DOCKER_REGISTRY_USER: dojohesso
DOCKER_REGISTRY_IMAGE: dojohesso/dojo_exercise_checker
PROJECT_NAME: DojoExerciseChecker
VERSION_DEV_SUFFIX: '-dev'
VERSION_TEST_SUFFIX: '-test'
GITLAB_API_PROJECT_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}
......
.get_version:
.get_vars:
script:
- IS_DEV=$([[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]] && echo false || echo true)
- VERSION=$(jq -r .version $PROJECT_FOLDER/package.json)$([[ $IS_DEV == true ]] && echo $VERSION_DEV_SUFFIX || echo '')
- IS_TEST=$([[ $CI_COMMIT_BRANCH == "test" ]] && echo false || echo true)
- |
if [ $IS_TEST == "true" ]; then
DOCKER_REGISTRY_USER=dojohessotest
DOCKER_REGISTRY_IMAGE=dojohesso/test-dojo_exercise_checker
DOCKER_REGISTRY_PASSWORD=$DOCKER_TEST_REGISTRY_PASSWORD
fi
.get_version:
script:
- VERSION=$(jq -r .version $PROJECT_FOLDER/package.json)$([[ $IS_DEV == true ]] && echo $VERSION_DEV_SUFFIX || echo '')$([[ $IS_TEST == true ]] && echo $VERSION_TEST_SUFFIX || echo '')
.get_packages_url:
......
......@@ -4,4 +4,7 @@ stages:
- build
- clean
- upload
- release
\ No newline at end of file
- release
before_script:
- !reference [ .get_vars, script ]
\ No newline at end of file
......@@ -9,4 +9,4 @@ test:build:
script:
- !reference [ .build_script, script ]
rules:
- if: '$CI_COMMIT_TAG =~ "/^$/" && $CI_COMMIT_REF_PROTECTED != "true"'
\ No newline at end of file
- if: '$CI_COMMIT_TAG =~ "/^$/" && $CI_COMMIT_REF_PROTECTED != "true" && $CI_COMMIT_BRANCH != "test"'
\ No newline at end of file
......@@ -12,4 +12,4 @@ build:version:
# Here docker buildx can use cached images created in previous step
- docker buildx build --platform $DOCKER_PLATFORMS --file $DOCKERFILE --push --tag $CONTAINER_IMAGE .
rules:
- if: '$CI_COMMIT_REF_PROTECTED == "true"'
\ No newline at end of file
- if: '$CI_COMMIT_REF_PROTECTED == "true" || $CI_COMMIT_BRANCH == "test"'
\ 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