forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
126 lines (108 loc) · 3.93 KB
/
azure-pipelines.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
# Docker image
# Build a Docker image to deploy, run, or push to a container registry.
# Add steps that use Docker Compose, tag images, push to a registry, run an image, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
batch: true
branches:
include:
- master
pr:
branches:
include:
- master
paths:
exclude:
- docs/src/main/*
- docs/src/main/topic/*
jobs:
- job: Build_Native_Linux
timeoutInMinutes: 120
pool:
vmImage: 'Ubuntu 16.04'
variables:
imageName: 'quarkus:$(build.buildId)'
steps:
- script: docker run --rm --publish 5432:5432 --name build-postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -d postgres:10.5
displayName: 'start postgres'
- task: Maven@3
displayName: 'Maven Build'
inputs:
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dnative-image.docker-build -Dtest-postgresql -Dnative-image.xmx=5g -Dnative -Dno-format'
- script: |
docker build -f docker/integration-test-main/Dockerfile -t jtgdocker1/quarkus-integration-test-main integration-tests/main
docker login -u jtgdocker1 -p uEo-NTv-5YT-kk6
docker push jtgdocker1/quarkus-integration-test-main
docker logout
displayName: Publishing Integration Test Main Container Image
- script: |
curl https://github.com/openshift/origin/releases/download/v3.10.0/openshift-origin-client-tools-v3.10.0-dd10d17-linux-64bit.tar.gz --location --output oc-client.tgz
tar -xzvf oc-client.tgz
cd openshift-origin-client*
sudo echo '{"insecure-registries": ["172.30.0.0/16"]}' > daemon.json
sudo mv daemon.json /etc/docker
sudo cat /etc/docker/daemon.json
sudo systemctl daemon-reload
sudo systemctl restart docker
./oc cluster up
displayName: 'Launch OpenShift'
- script: |
function wait_for_pod() {
echo -n "Waiting for $1."
count=0;
VAL=""
while [ "$VAL" != "Running" ]
do
echo -n .
if [ $count -gt 20 ]; then
echo "Timed out waiting for $1!"
exit 1
fi
count=$((count+1))
sleep 2;
VAL=`./oc get pods | grep $1 | awk '{print $3}'`
done
echo "Ready!"
}
cd openshift-origin-client*
docker login -u jtgdocker1 -p uEo-NTv-5YT-kk6
docker pull jtgdocker1/quarkus-integration-test-main
docker pull centos/postgresql-10-centos7
docker logout
./oc create secret docker-registry jtgdocker1 --docker-username=jtgdocker1 --docker-password=uEo-NTv-5YT-kk6 --docker-email='[email protected]'
./oc secrets link default jtgdocker1 --for=pull
./oc new-app -e "POSTGRESQL_USER=hibernate_orm_test" -e "POSTGRESQL_PASSWORD=hibernate_orm_test" -e "POSTGRESQL_DATABASE=hibernate_orm_test" centos/postgresql-10-centos7
wait_for_pod postgres
./oc new-app jtgdocker1/quarkus-integration-test-main
wait_for_pod quarkus
./oc status
VAL=`./oc get service quarkus-integration-test-main -o "custom-columns=IP:.spec.clusterIP" --no-headers=true`
VAL2=`curl -v http://$VAL:8080/jpa/testjpaeminjection`
test "$VAL2" = "OK"
displayName: 'Deploy and Test On Openshift'
- job: Windows_Build
timeoutInMinutes: 60
pool:
vmImage: 'vs2017-win2016'
variables:
imageName: 'quarkus-windows:$(build.buildId)'
steps:
- task: Maven@3
displayName: 'Maven Build'
inputs:
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format'
- job: Build_JDK11_Linux
timeoutInMinutes: 60
pool:
vmImage: 'Ubuntu 16.04'
variables:
imageName: 'quarkus-jdk11:$(build.buildId)'
steps:
- task: Maven@3
displayName: 'Maven Build'
inputs:
jdkVersionOption: '1.11'
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format'