forked from ome/omero-gradle-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
60 lines (53 loc) · 1.95 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
pipeline {
agent {
label 'testintegration'
// docker {
// image 'docker.io/manics/omero-build-gradle:latest'
// }
}
environment {
// Default credentials for testing on devspace
MAVEN_SNAPSHOTS_REPO_URL = 'http://nexus:8081/nexus/repository/maven-internal/'
MAVEN_USER = 'admin'
MAVEN_PASSWORD = 'admin123'
// omero-artifact-plugin handles publishing of other artifacts, but it also needs to publish itself
MAVEN_REPO_URL = 'http://nexus:8081/nexus/repository/maven-internal/'
// Disable Gradle daemon
GRADLE_OPTS = '-Dorg.gradle.daemon=false'
}
stages {
stage('Versions') {
steps {
copyArtifacts(projectName: 'BIOFORMATS-build', flatten: true, filter: 'target/version.properties')
// build is in .gitignore so we can use it as a temp dir
sh """
mkdir ${env.WORKSPACE}/build
cd ${env.WORKSPACE}/build && curl -sfL https://github.com/ome/build-infra/archive/master.tar.gz | tar -zxf -
export PATH=$PATH:${env.WORKSPACE}/build/build-infra-master/
cd ..
# Workaround for "unflattened" file, possibly due to matrix
find . -name version.properties -exec cp {} . \\;
test -e version.properties
foreach-get-version-as-property >> version.properties
"""
archiveArtifacts artifacts: 'version.properties'
}
}
stage('Build') {
steps {
sh 'gradle --init-script init-ci.gradle publishToMavenLocal'
}
}
stage('Deploy') {
steps {
sh 'gradle --init-script init-ci.gradle publish'
}
}
}
post {
always {
// Cleanup workspace
deleteDir()
}
}
}