-
Jan-Niclas Strüwer authoredJan-Niclas Strüwer authored
.gitlab-ci.yml 1.97 KiB
stages:
- clone
- build
- test
- build_kubernetes
- deploy
clone_occmd:
image: alpine/git
stage: clone
only:
- main
script:
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.opencode.de/opencode-analyzer/occmd
artifacts:
paths:
- occmd/
build:
image:
name: gradle:jdk21-alpine
stage: build
script:
- sh $CI_PROJECT_DIR/gradlew assemble
dependencies:
- clone_occmd
test:
image:
name: gradle:jdk21-alpine
stage: test
script:
- sh $CI_PROJECT_DIR/gradlew test -Dspring.profiles.active=test
- sh $CI_PROJECT_DIR/gradlew detekt
dependencies:
- build
.base:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
cache: { }
tags:
- "opencode-high"
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
build_sha:
extends: .base
stage: build_kubernetes
only:
- main
script:
- /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}"
dependencies:
- clone_occmd
#build_latest:
# extends: .base
# stage: build_kubernetes
# only:
# - main
# script:
# - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:latest"
# dependencies:
# - clone_occmd
deploy:
image: bitnami/kubectl
before_script: