-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathJenkinsfile
68 lines (66 loc) · 2.25 KB
/
Jenkinsfile
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
// This Jenkinsfile will build the docker images for all WaziGate components.
// After that, it will restart them on a test WaziGate RPI and run the test suite.
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
}
environment {
WAZIGATE_TAG = 'nightly'
}
stages {
stage('Prepare') {
steps {
sh 'pip3 install unittest-xml-reporting'
sh 'docker run --rm --privileged multiarch/qemu-user-static --reset -p yes'
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
sh 'docker buildx create --name rpibuilder --platform linux/arm/v7; true'
}
sh 'docker buildx use rpibuilder'
sh 'docker buildx inspect --bootstrap'
}
}
stage('Build') {
steps {
dir("wazigate-edge") {
git branch: 'v2', url: 'https://github.com/Waziup/wazigate-edge.git'
dir ("wazigate-dashboard") {
git 'https://github.com/Waziup/wazigate-dashboard.git'
}
sh 'docker buildx build --platform=linux/arm64 --tag waziup/wazigate-edge:$WAZIGATE_TAG --push --progress plain .'
}
dir("wazigate-system") {
git 'https://github.com/Waziup/wazigate-system.git'
sh 'docker buildx build --platform=linux/arm64 --tag waziup/wazigate-system:$WAZIGATE_TAG --push --progress plain .'
}
dir("wazigate-lora") {
git branch: 'v2', url: 'https://github.com/Waziup/wazigate-lora.git'
sh 'docker buildx build --platform=linux/arm64 --tag waziup/wazigate-lora:$WAZIGATE_TAG --push --progress plain .'
dir("forwarders") {
sh 'docker buildx build --platform=linux/arm64 --tag waziup/wazigate-lora-forwarders --push --progress plain .'
}
}
}
}
stage('Stage') {
steps {
sh 'echo "restart containers on RPI"'
sh 'ssh -o StrictHostKeyChecking=no pi@$WAZIGATE_IP "cd /var/lib/wazigate; sudo WAZIGATE_TAG=nightly ./update_containers.sh"'
}
}
stage('Test') {
steps {
dir('tests'){
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'sudo -E python3 tests.py'
}
}
}
}
}
post {
always {
junit 'tests/results.xml'
}
}
}