forked from zalando/nakadi
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
144 lines (129 loc) · 4.51 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
include:
- project: wiley-sons/tc-gitlab-templates
file: autodevops-gradle.gitlab-ci.yml
variables:
APP_NAME: eventhub
AUTO_DEVOPS_DEPLOY_DEBUG: "true"
build:
variables:
BP_JVM_VERSION: "11.*"
BP_GRADLE_BUILT_ARTIFACT: "app/build/libs/*.[jw]ar"
BP_GRADLE_BUILD_ARGUMENTS: ":app:bootJar"
BP_LOG_LEVEL: "DEBUG"
AUTO_DEVOPS_BUILD_IMAGE_FORWARDED_CI_VARIABLES: "BP_GRADLE_BUILT_ARTIFACT,BP_GRADLE_BUILD_ARGUMENTS,BP_JVM_VERSION,BP_LOG_LEVEL"
#APP_NAME: eventhub
#IMAGE_NAME: $CI_REGISTRY/tc/$APP_NAME:latest
#image:
#name: gradle:5.3.1-jdk11-slim
#before_script:
#- echo "JAVA_HOME"
#- echo $JAVA_HOME
#- export JAVA_HOME="/docker-java-home"
#- echo $JAVA_HOME
#- sh $CI_PROJECT_DIR/gradlew build
#artifacts:
#paths:
#- app/build/libs/*.[jw]ar
#image:
#name: quay.io/podman/stable
# script:
# - pack config trusted-builders add paketo-buildpacks/gradle
# - pack config trusted-builders add paketo-buildpacks/apache-tomcat
# - pack config trusted-builders add paketo-buildpacks/spring-boot
# - pack config trusted-builders add paketo-buildpacks/dist-zip
# - pack config trusted-builders add paketo-buildpacks/ca-certificates
# - pack config trusted-builders add paketo-buildpacks/bellsoft-liberica
# - pack config trusted-builders add paketo-buildpacks/syft
# - pack config trusted-builders add paketo-buildpacks/liberty
# - /build/build.sh
#- podman login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
#- podman build -t "$IMAGE_NAME" .
#- podman push "$IMAGE_NAME"
review:
variables:
KUBE_NAMESPACE: eventhub-review
K8S_SECRET_SPRING_PROFILES_ACTIVE: review
HELM_UPGRADE_VALUES_FILE: .gitlab/auto-deploy-values-review.yaml
after_script:
- echo "HOST_IP=$(kubectl get pods -l app=$APP_NAME-$CI_ENVIRONMENT_SLUG --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1:]..status.podIP}' -n eventhub-review)" >> deploy.env
stop_review:
variables:
KUBE_NAMESPACE: eventhub-review
review-integrationtest:
image: artifactory.aws.wiley.com/docker/openjdk:11-jdk
tags:
- dev
extends: .review-integration-test
variables:
ENVIRONMENT_HOST: environment_url.txt
script:
- echo "$HOST_IP"
- "TEST_ENV=review NAKADI_BASE_URL=http://$HOST_IP POSTGRES_URL=jdbc:postgresql://$HOST_IP:5432/local_nakadi_db ZOOKEEPER_URL=$HOST_IP:2181 KAFKA_URL=$HOST_IP:29092 ./gradlew :acceptance-test:acceptanceTest"
dev:
variables:
KUBE_NAMESPACE: eventhub-dev
K8S_SECRET_SPRING_PROFILES_ACTIVE: dev
KUBE_INGRESS_BASE_DOMAIN: dev.tc.private.wiley.host
HELM_UPGRADE_VALUES_FILE: .gitlab/auto-deploy-values-dev.yaml
dev-integrationtest:
when: manual
image: artifactory.aws.wiley.com/docker/openjdk:11-jdk
tags:
- dev
variables:
APP_ENVIRONMENT: dev
allow_failure: true
extends: .dev-integration-test
script:
- "TEST_ENV=dev POSTGRES_PWD=$EVENTHUB_DB_PASSWORD_DEV ./gradlew :acceptance-test:acceptanceTest"
qa:
variables:
KUBE_NAMESPACE: eventhub-qa
K8S_SECRET_SPRING_PROFILES_ACTIVE: qa
KUBE_INGRESS_BASE_DOMAIN: qa.tc.wiley.host
HELM_UPGRADE_VALUES_FILE: .gitlab/auto-deploy-values-qa.yaml
qa-integrationtest:
when: manual
image: artifactory.aws.wiley.com/docker/openjdk:11-jdk
tags:
- dev
variables:
APP_ENVIRONMENT: qa
allow_failure: true
extends: .qa-integration-test
script:
- "TEST_ENV=qa POSTGRES_PWD=$EVENTHUB_DB_PASSWORD_QA ./gradlew :acceptance-test:acceptanceTest"
uat:
variables:
KUBE_NAMESPACE: eventhub-uat
K8S_SECRET_SPRING_PROFILES_ACTIVE: uat
KUBE_INGRESS_BASE_DOMAIN: uat.tc.wiley.host
HELM_UPGRADE_VALUES_FILE: .gitlab/auto-deploy-values-uat.yaml
uat-integrationtest:
when: manual
image: artifactory.aws.wiley.com/docker/openjdk:11-jdk
tags:
- uat
variables:
APP_ENVIRONMENT: uat
allow_failure: true
extends: .uat-integration-test
script:
- "TEST_ENV=uat POSTGRES_PWD=$EVENTHUB_DB_PASSWORD_UAT ./gradlew :acceptance-test:acceptanceTest"
prod:
variables:
KUBE_NAMESPACE: eventhub-prod
K8S_SECRET_SPRING_PROFILES_ACTIVE: prod
KUBE_INGRESS_BASE_DOMAIN: prod.tc.private.wiley.host
HELM_UPGRADE_VALUES_FILE: .gitlab/auto-deploy-values-prod.yaml
prod-integrationtest:
when: manual
image: artifactory.aws.wiley.com/docker/openjdk:11-jdk
tags:
- prod
variables:
APP_ENVIRONMENT: prod
allow_failure: true
extends: .prod-integration-test
script:
- "TEST_ENV=prod POSTGRES_PWD=$EVENTHUB_DB_PASSWORD_PROD ./gradlew :acceptance-test:acceptanceTest"