Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.04 KiB
Newer Older
variables:
    GIT_SUBMODULE_STRATEGY: recursive

Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
stages:

build:
    image:
        name: gradle:jdk21-alpine
    stage: build
    script:
        - sh $CI_PROJECT_DIR/gradlew assemble

test:
    image:
        name: gradle:jdk21-alpine
    stage: test
    script:
        - sh $CI_PROJECT_DIR/gradlew test -Dspring.profiles.active=test
Jan-Niclas Strüwer's avatar
Jan-Niclas Strüwer committed
.base:
        name: gcr.io/kaniko-project/executor:v1.23.2-debug
        entrypoint: [""]
    cache: {}
    before_script:
        - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
build_sha_dev:
    extends: .base
    stage: build_kubernetes_dev
    only:
        - dev
    script:
        - /kaniko/executor --build-arg "profile=dev" --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:dev_${CI_COMMIT_SHORT_SHA}"

build_sha_prod:
    extends: .base
    stage: build_kubernetes
    script:
        - /kaniko/executor --build-arg "profile=prod" --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}" --destination "${CI_REGISTRY_IMAGE}:latest"
deploy_development:
    image: bitnami/kubectl:1.30-debian-12
    before_script:
        - export KUBECONFIG=$KUBECONFIG_FILE
    stage: deploy
    only:
        - dev
    script:
        - ./kubernetes/scripts/deploy.sh "dev" "${CI_COMMIT_SHORT_SHA}" "${CI_DEPLOY_USER} requested to deploy ${CI_COMMIT_BRANCH} ${CI_COMMIT_SHA}"
deploy_production:
    image: bitnami/kubectl:1.30-debian-12
    before_script:
        - export KUBECONFIG=$KUBECONFIG_FILE
    stage: deploy
    only:
        - main
    script:
        - ./kubernetes/scripts/deploy.sh "prod" "${CI_COMMIT_SHORT_SHA}" "${CI_DEPLOY_USER} requested to deploy ${CI_COMMIT_BRANCH} ${CI_COMMIT_SHA}"

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.