-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
48 lines (38 loc) · 1.09 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
# pipeline base image
image:
name: stakater/gitlab:0.0.3
# Configuring CI/CD environment variables
variables:
# stack configuraton variables
BRANCH: "add-manifests"
TARGET: "install-dry-run"
INSTALL_PVC: "false"
# k8s cluster configuration variables
NAMESPACE: "mesh"
# configuring pre-requisites required during pipeline execution
before_script:
- echo "Displaying non-sensitive config parameters on pipeline logs"
- echo $BRANCH
- echo $TARGET
- echo $INSTALL_PVC
- echo $NAMESPACE
# Configuring kubernetes cluster access
- echo "configuration kubernetes access in pipeline"
- mkdir ~/.kube/
- echo $KUBE_CONFIG | base64 -d > config
- mv config ~/.kube/
# pipeline stages
stages:
- deploy
deploy:
stage: deploy
# pipeline execution script
script:
- echo "Checkout to the deployment branch"
- git checkout $BRANCH
- echo "Deploying stack on kubernetes cluster"
- if [ -z "$NAMESPACE" ]; then \
- make $TARGET INSTALL_PVC=$INSTALL_PVC; \
- else \
- make $TARGET NAMESPACE=$NAMESPACE INSTALL_PVC=$INSTALL_PVC; \
- fi