-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
59 lines (49 loc) · 2.65 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
stages:
- build
- deploy
maven-build:
image: maven:3.6.3-openjdk-11
stage: build
script:
- mvn clean install jib:build -Djib.to.image=docker.io/"$DOCKER_HUB_USER"/$DOCKER_HUB_REPO:"$CI_COMMIT_REF_NAME" -Djib.to.auth.username="$DOCKER_HUB_USER" -Djib.to.auth.password="$DOCKER_HUB_TOKEN" -Djib.to.tags=${CI_COMMIT_SHA}
- mvn jib:build -Djib.to.auth.username=${CI_REGISTRY_USER} -Djib.to.auth.password=${CI_REGISTRY_PASSWORD} -Djib.to.image=${CI_REGISTRY_IMAGE}:"$CI_COMMIT_REF_NAME" -Djib.to.tags=${CI_COMMIT_SHA}
only:
refs:
- master
- dev
deploy-HH-WP-WEBADMIN-dev:
stage: deploy
image: dtzar/helm-kubectl:2.13.0
script:
- kubectl config set-cluster local --server="${HH_WP_WEBADMIN_ENDPOINT}"
- kubectl config set clusters.local.certificate-authority-data "${HH_WP_WEBADMIN_CERTIFICATE_AUTHORITY}"
- kubectl config set-credentials ${HH_WP_WEBADMIN_DEV_USER} --token="${HH_WP_WEBADMIN_DEV_USER_TOKEN}"
- kubectl config set-context "${HH_WP_WEBADMIN_DEV_NAMESPACE}" --cluster=local --user=${HH_WP_WEBADMIN_DEV_USER} --namespace="${HH_WP_WEBADMIN_DEV_NAMESPACE}"
- kubectl config use-context "${HH_WP_WEBADMIN_DEV_NAMESPACE}"
- kubectl version
- sed -i "s/latest/$CI_COMMIT_SHA/g" k8-deploy/dev/pdx-admin-api-dev-deployment.yaml
- kubectl apply -f k8-deploy/dev/pdx-admin-api-dev-deployment.yaml --record
- kubectl rollout status -f k8-deploy/dev/pdx-admin-api-dev-deployment.yaml
- kubectl apply -f k8-deploy/dev/pdx-admin-api-dev-service.yaml --record
- kubectl get pods,service,deploy,replicaset,ing -n "${HH_WP_WEBADMIN_DEV_NAMESPACE}"
only:
refs:
- dev
deploy-HH-WP-WEBADMIN-master:
stage: deploy
image: dtzar/helm-kubectl:2.13.0
script:
- kubectl config set-cluster local --server="${HH_WP_WEBADMIN_ENDPOINT}"
- kubectl config set clusters.local.certificate-authority-data "${HH_WP_WEBADMIN_CERTIFICATE_AUTHORITY}"
- kubectl config set-credentials ${HH_WP_WEBADMIN_USER} --token="${HH_WP_WEBADMIN_USER_TOKEN}"
- kubectl config set-context "${HH_WP_WEBADMIN_NAMESPACE}" --cluster=local --user=${HH_WP_WEBADMIN_USER} --namespace="${HH_WP_WEBADMIN_NAMESPACE}"
- kubectl config use-context "${HH_WP_WEBADMIN_NAMESPACE}"
- kubectl version
- sed -i "s/latest/$CI_COMMIT_SHA/g" k8-deploy/prod/pdx-admin-api-deployment.yaml
- kubectl apply -f k8-deploy/prod/pdx-admin-api-deployment.yaml --record
- kubectl rollout status -f k8-deploy/prod/pdx-admin-api-deployment.yaml
- kubectl apply -f k8-deploy/prod/pdx-admin-api-service.yaml --record
- kubectl get pods,service,deploy,replicaset,ing -n "${HH_WP_WEBADMIN_NAMESPACE}"
only:
refs:
- master