Projekt

Obecné

Profil

« Předchozí | Další » 

Revize cd2fea4c

Přidáno uživatelem Michal Schwob před více než 2 roky(ů)

  • ID cd2fea4c8d995192a13d92ea98aef5369d56485d
  • Rodič 053244c6

Revert "Update .gitlab-ci.yml file"

This reverts commit 053244c695bdba92a23ec00b3634fd4b1e5c1100

Zobrazit rozdíly:

.gitlab-ci.yml
1
# https://docs.gitlab.com/ee/ci/
2
image: alpine:3.12
3

  
4 1
variables:
5
  K8S_VERSION: v1.20.5
6
  APP: ${CI_REGISTRY_IMAGE}/app:${CI_COMMIT_SHORT_SHA}
7
  KUSTOMIZE: kustomization/kustomize.yaml
2
  DOCKER_HOST: tcp://docker:2375
8 3

  
9
# build docker images
10
build application image:
4
build:
5
  image: docker:19.03.12
11 6
  stage: build
12
  image:
13
    name: gcr.io/kaniko-project/executor:debug
14
    entrypoint: [""]
15
  # comment this out on production
16
  when: manual
17
  script:
18
    - mkdir -p /kaniko/.docker
19
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
20
    - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile docker/application/Dockerfile --destination $APP --verbosity info
21 7

  
22
# deploy test to kubernetes
23
deploy test:
24
  stage: deploy
25
  environment: production
26
  #only:
27
  #  - /^test/
28
  when: manual
29
  script:
30
    - wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/$K8S_VERSION/bin/linux/amd64/kubectl
31
    - chmod +x /usr/local/bin/kubectl
32
    - kubectl version
33
    - apk add gettext git
34
    - kubectl kustomize kustomization/ | envsubst | tee $KUSTOMIZE
35
    - kubectl apply -f $KUSTOMIZE
8
  
36 9

  
10
  services:
11
    - docker:19.03.12-dind
12
  script:
13
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD gitlab.kiv.zcu.cz:5000
14
    - docker build -t $CI_REGISTRY/aswi/aswi-2022/aswi2022code-of-duty:latest ./backend
15
    - docker push $CI_REGISTRY/aswi/aswi-2022/aswi2022code-of-duty:latest

Také k dispozici: Unified diff