forked from scify/JedAI-Spark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
66 lines (64 loc) · 2.07 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
def user_id
def group_id
node {
user_id = sh(returnStdout: true, script: 'id -u').trim()
group_id = sh(returnStdout: true, script: 'id -g').trim()
}
pipeline {
agent {
dockerfile {
dir '.ops/build-docker'
args '-v /var/run/docker.sock:/var/run/docker.sock -v /etc/group:/etc/group'
additionalBuildArgs "--build-arg USER_ID=${user_id} --build-arg GROUP_ID=${group_id}"
}
}
parameters {
string(name: 'ARTIFACT_TAG', defaultValue: '', description: 'The tag used to stage artifacts (requires creating release zip and will push artifacts to artifactory, docker, etc.)')
string(name: 'SLACK', defaultValue: '', description: 'The slack channel to notify of the builds results. This is typically #notifications-eng-gh.')
}
options {
timeout(time: 30, unit: 'MINUTES')
}
environment {
jenkinsOsxPub = credentials('jenkins.osx.pub')
jenkinsOsxPriv = credentials('jenkins.osx.priv')
artifactoryUsername = credentials('artifactoryUsername')
artifactoryPassword = credentials('artifactoryPassword')
LANG = 'C.UTF-8'
}
stages {
stage('Build') {
steps {
script {
sh "sbt assembly"
}
}
}
stage('Publish jars and zip to Jfrog maven repo') {
steps {
script {
sh "sudo chmod -R 755 ./ops"
sh "./ops/jenkins/delete-nightly-snapshot.sh"
sh "./ops/jenkins/publish_artifacts.sh"
}
}
}
stage('Slack Message') {
when { expression { params.SLACK != "" } }
steps {
script {
notifyBuild("Success :discodancer:", "GREEN", params)
}
}
}
}
post {
failure {
script {
if (params.SLACK != "") {
notifyBuild("Failed :computerrage:", "RED", params)
}
}
}
}
}