aboutsummaryrefslogtreecommitdiff
blob: af22518c3c638518de8f372e56899011b64cc34f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
stages:
  - go-test
  - build
  - test
  - dast

build:
  stage: build
  image:
    name: gcr.io/kaniko-project/executor:v1.9.1-debug
    entrypoint: [""]
  except:
    - tags
  variables:
    IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_SHA
    UPDATER_IMAGE_TAG: $CI_REGISTRY_IMAGE/updater-$CI_COMMIT_BRANCH:$CI_COMMIT_SHA
    LATEST_IMAGE_TAG: $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:latest
    LATEST_UPDATER_IMAGE_TAG: $CI_REGISTRY_IMAGE/updater-$CI_COMMIT_BRANCH:latest
  before_script:
    - echo $IMAGE_TAG
    - echo $UPDATER_IMAGE_TAG
    - echo $LATEST_IMAGE_TAG
    - echo $LATEST_UPDATER_IMAGE_TAG
  script:
    - /kaniko/executor
      --cache=true
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
      --destination "${IMAGE_TAG}"
      --destination "${LATEST_IMAGE_TAG}"
    - /kaniko/executor
      --cache=true
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile.updater"
      --destination "${UPDATER_IMAGE_TAG}"
      --destination "${LATEST_UPDATER_IMAGE_TAG}"

build-tag:
  stage: build
  only:
    - tags
  variables:
    IMAGE_TAG: $CI_REGISTRY_IMAGE/web:$CI_COMMIT_TAG
    UPDATER_IMAGE_TAG: $CI_REGISTRY_IMAGE/updater:$CI_COMMIT_TAG
  before_script:
    - echo $IMAGE_TAG
    - echo $UPDATER_IMAGE_TAG
  script:
    - /kaniko/executor
      --cache=true
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
      --destination "${IMAGE_TAG}"
    - /kaniko/executor
      --cache=true
      --context "${CI_PROJECT_DIR}"
      --dockerfile "${CI_PROJECT_DIR}/Dockerfile.updater"
      --destination "${UPDATER_IMAGE_TAG}"

go-test:
  stage: go-test
  image: golang:1.22.2
  script:
    - go test -v ./pkg/models/...