stages:
  - clone
  - build

clone:
  image: alpine/git
  stage: clone
  script:
    - git clone https://oauth2:${CI_JOB_TOKEN}@gitlab.opencode.de/opencode-analyzer/occmd.git
.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:
  extends: .base
  stage: build
  script:
    - /kaniko/executor --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/Dockerfile" --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"