-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
89 lines (78 loc) · 2.01 KB
/
.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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
include:
- project: "infrastructure-engineering-shared/gitlab-ci-templates"
file:
- "lint_docker.yaml"
- "build_and_scan_docker.yaml"
- "kubectl_commands.yaml"
- "sast_scanning.yaml"
variables:
IMAGE: "tulibraries/padigital"
HARBOR: "harbor.k8s.temple.edu"
HELM_EXPERIMENTAL_OCI: "1"
.export_variables: &export_variables
- source .env.prod
- export VERSION="${DOCKER_IMAGE_VERSION}-${CI_COMMIT_SHORT_SHA}"
before_script:
- *export_variables
stages:
- lint
- build
- tag
- deploy
lint:
extends: .lint_docker
variables:
DF: ".docker/app/Dockerfile"
except:
- tags
build:
stage: build
extends: .build_and_scan_image
variables:
DF: ".docker/app/Dockerfile --build-arg SECRET_KEY_BASE=$SECRET_KEY_BASE --no-cache"
except:
- tags
tag:
stage: tag
extends: .tag_image
except:
- tags
qa_deploy:
variables:
IMAGE: $HARBOR/tulibraries/padigital
RANCHER: rancher-np
CLUSTER: $DEV_CLUSTER
stage: deploy
extends: .helm_setup
only:
- main
script:
- *export_variables
- helm pull oci://$HARBOR/tulibraries/charts/padigital --untar
- helm upgrade padigital oci://$HARBOR/tulibraries/charts/padigital --history-max=5 --namespace=padigital-qa --values padigital/values.yaml --set image.repository=$IMAGE:$VERSION
tag_prod:
stage: tag
extends: .tag_image
variables:
TAG: prod
only:
- tags
tag_release:
stage: tag
extends: .tag_image
variables:
TAG: $CI_COMMIT_TAG
only:
- tags
prod_deploy:
variables:
IMAGE: harbor.k8s.temple.edu/tulibraries/padigital
RANCHER: rancher
CLUSTER: $PROD_CLUSTER
stage: deploy
extends: .helm_setup
only:
- tags
script:
- helm pull oci://$HARBOR/tulibraries/charts/padigital --version $HELM_VERSION_PROD --untar
- helm upgrade padigital oci://$HARBOR/tulibraries/charts/padigital --version $HELM_VERSION_PROD --history-max=5 --namespace=padigital-prod --values padigital/values-prod.yaml --set image.repository=$IMAGE:$CI_COMMIT_TAG