-
Notifications
You must be signed in to change notification settings - Fork 9
/
run_tests_with_dekorate_in_k8s.sh
executable file
·32 lines (26 loc) · 1.3 KB
/
run_tests_with_dekorate_in_k8s.sh
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
#!/usr/bin/env bash
CONTAINER_REGISTRY=${1:-localhost:5000}
K8S_NAMESPACE=${2:-k8s}
MAVEN_OPTS=${3:-}
source scripts/waitFor.sh
kubectl config set-context --current --namespace=$K8S_NAMESPACE
# launch the cache service
kubectl apply -f .openshiftio/cache.yml
if [[ $(waitFor "cache-server" "app") -eq 1 ]] ; then
echo "Cache server failed to deploy. Aborting"
exit 1
fi
# 1.- Deploy Cute Name Service
./mvnw -s .github/mvn-settings.xml clean verify -pl cute-name-service -Pkubernetes -Ddekorate.docker.registry=$CONTAINER_REGISTRY -Dkubernetes.namespace=$K8S_NAMESPACE -Ddekorate.push=true -Ddekorate.deploy=true $MAVEN_OPTS
if [[ $(waitFor "spring-boot-cache-cutename" "app.kubernetes.io/name") -eq 1 ]] ; then
echo "Cute name service failed to deploy. Aborting"
exit 1
fi
# 2.- Deploy Greeting Service
./mvnw -s .github/mvn-settings.xml clean verify -pl greeting-service -Pkubernetes -Ddekorate.docker.registry=$CONTAINER_REGISTRY -Dkubernetes.namespace=$K8S_NAMESPACE -Ddekorate.push=true -Ddekorate.deploy=true $MAVEN_OPTS
if [[ $(waitFor "spring-boot-cache-greeting" "app.kubernetes.io/name") -eq 1 ]] ; then
echo "Greeting name service failed to deploy. Aborting"
exit 1
fi
# 3.- Run Tests
./mvnw -s .github/mvn-settings.xml verify -pl tests -Pkubernetes-it -Dkubernetes.namespace=$K8S_NAMESPACE $MAVEN_OPTS