-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
37 lines (35 loc) · 939 Bytes
/
.gitlab-ci.yml
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
stages:
- build
- deploy
build:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
# Authenticate at the registry
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# Build and push the image
- /kaniko/executor
--context $CI_PROJECT_DIR/app
--dockerfile ./Dockerfile
--destination $CI_REGISTRY_IMAGE/app:$CI_COMMIT_TAG
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
changes:
- app/**/*
variables:
GIT_SUBMODULE_STRATEGY: recursive
# Chose the gitlab runner tag
tags:
- lrz
deploy:
stage: deploy
image: fluxcd/flux-cli:v0.21.1
script:
- export KUBECONFIG=kubeconfig_group06.yaml
- flux reconcile kustomization -n group06 group06 --with-source
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
tags:
- lrz