This repository has been archived by the owner on Nov 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Jenkinsfile
86 lines (85 loc) · 3.17 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*********************************************************************
* Copyright (c) 2019 Bosch Software Innovations GmbH [and others]
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
pipeline {
agent {
kubernetes {
label 'kuksa-release-pod'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: gradle
image: gradle:6.9-jdk11
command:
- cat
tty: true
env:
- name: "GRADLE_USER_HOME"
value: "/home/jenkins/.gradle"
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "1"
volumeMounts:
- mountPath: "/home/jenkins"
name: "jenkins-home"
readOnly: false
volumes:
- name: "jenkins-home"
emptyDir: {}
"""
}
}
stages {
stage('Run Gradle') {
steps {
container('gradle') {
sh 'mkdir release && mkdir release/utils && mkdir release/examples && mkdir release/utils/hono-influxdb-connector && mkdir release/examples/malfunction-indicator-light'
dir('utils/hono-influxdb-connector') {
sh 'gradle build'
sh 'curl -o ../../release/utils/hono-influxdb-connector/hono-influxdb-connector.jar -F file=@build/libs/hono-influxdb-connector-0.2.0.jar http://build.eclipse.org:31338/sign'
sh 'cp pushImage.sh ../../release/utils/hono-influxdb-connector/pushImage.sh && cp README.md ../../release/utils/hono-influxdb-connector/README.md'
}
dir('examples/malfunction-indicator-light') {
dir('influxdb-rest') {
sh 'gradle build'
sh 'curl -o build/libs/influxdb-rest.jar -F file=@build/libs/influxdb-rest-0.1.0.jar http://build.eclipse.org:31338/sign'
sh 'cp build/libs/influxdb-rest.jar ../../../release/examples/malfunction-indicator-light/influxdb-rest.jar'
}
dir('mail-notification') {
sh 'gradle build'
sh 'curl -o build/libs/mail-notification.jar -F file=@build/libs/mail-notification-0.1.0.jar http://build.eclipse.org:31338/sign'
sh 'cp build/libs/mail-notification.jar ../../../release/examples/malfunction-indicator-light/mail-notification.jar'
}
dir('mil-service') {
sh 'gradle build'
sh 'cd build/libs && ls'
sh 'curl -o build/libs/indicator-light-service.jar -F file=@build/libs/indicator-light-service-0.1.0.jar http://build.eclipse.org:31338/sign'
sh 'cp build/libs/indicator-light-service.jar ../../../release/examples/malfunction-indicator-light/indicator-light-service.jar'
}
}
sh 'cp -r deployment release/deployment'
sh 'cp -r utils/interact-with-hono release/utils/interact-with-hono'
sh 'tar -cvf kuksa-cloud-release.tar release'
archiveArtifacts 'kuksa-cloud-release.tar'
}
}
}
}
post {
failure {
sh 'echo failure'
}
}
}