This repository has been archived by the owner on Jan 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
79 lines (67 loc) · 2.36 KB
/
TomcatIntegrationTest.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
# End to end integration test which deploys the Tomcat operator to a Kubernetes
# (Kind) cluster and creates custom resources to verify the operator's functionality
name: Tomcat integration test
on:
push:
branches:
- "*"
jobs:
tomcat_integration_test:
runs-on: ubuntu-latest
env:
KIND_CL_NAME: tomcat-integration-test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: clean resident local docker
if: ${{ env.ACT }}
continue-on-error: true
run: |
for DIMG in "$KIND_CL_NAME-control-plane "; do
docker stop $DIMG ; docker rm $DIMG ;
done ;
sleep 1
- name: Create Kubernetes KinD Cluster
uses: container-tools/[email protected]
with:
cluster_name: tomcat-integration-test
registry: false
- name: Apply CRDs
run: kubectl apply -f tomcat/k8s/crd.yaml
- name: Set up Java and Maven
uses: actions/setup-java@v2
with:
java-version: 15
distribution: adopt-hotspot
- name: cache
uses: actions/cache@v2
if: ${{ !env.ACT }}
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-m2
- name: Set up Maven
uses: stCarolas/setup-maven@v4
if: ${{ env.ACT }}
with:
maven-version: 3.8.1
- name: build jib
run: |
mvn --version
mvn -B package jib:dockerBuild jib:buildTar -Djib-maven-image=tomcat-operator --file tomcat/pom.xml -DskipTests
kind load image-archive tomcat/target/jib-image.tar --name=${{ env.KIND_CL_NAME }}
- name: Apply CRDs
run: kubectl apply -f tomcat/k8s/crd.yaml
- name: install tomcat operator
run: |
kubectl apply -f tomcat/k8s/operator.yaml
- name: create ns tomcatoperator-sample
run: kubectl create ns tomcatoperator-sample
- name: Run unit tests
run: mvn -B test -q --file tomcat/pom.xml
- name: Dump state
if: ${{ failure() }}
run: |
kubectl get all -n tomcat-test -o yaml
kubectl logs curl -n tomcat-test