-
Notifications
You must be signed in to change notification settings - Fork 5
/
conda_build_one.jenkinsfile
64 lines (54 loc) · 1.7 KB
/
conda_build_one.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
pipeline {
agent any
options {
ansiColor('xterm')
timestamps()
timeout(time: 2, unit: 'HOURS')
}
parameters {
string(name: 'BRANCH', defaultValue: 'develop', description: '')
string(name: 'CONDA_BUILD', defaultValue: 'blazingsql-nightly', description: 'Channels from build, example: blazingsql-nightly,rapidsai-nightly')
string(name: 'CONDA_UPLOAD', defaultValue: 'blazingsql-nightly', description: 'The Anaconda repository could be: blazingsql, blazingsql-nightly, mario21ic, etc')
string(name: 'CONDA_TOKEN', defaultValue: 'conda-token-nightly', description: 'Token to upload package')
string(name: 'SLACK_CHANNEL', defaultValue: 'jenkins-blazingsql', description: '')
}
environment {
SLACK_MESSAGE=" - Job '${env.JOB_NAME}' - Build #${env.BUILD_NUMBER}: ${env.BUILD_URL}"
}
stages {
stage("Repository") {
steps {
checkout scm
}
}
stage("Compile & Publish") {
steps {
withCredentials([string(credentialsId: "${params.CONDA_TOKEN}", variable: 'TOKEN')]) {
sh "./conda-build-docker.sh ${params.CONDA_BUILD} ${params.CONDA_UPLOAD} $TOKEN"
}
}
}
}
// Method to post jenkinsfile
post {
always {
echo "Job has finished"
}
success {
slackSendMessage("Success", "good")
}
failure {
slackSendMessage("Failure", "danger")
}
unstable {
slackSendMessage("Warning", "warning")
}
}
}
// Method to send notifications for slack
def slackSendMessage(String status="Started", String color){
slackSend channel: "${params.SLACK_CHANNEL}",
color: color,
failOnError: true,
message: "${status}" + "${env.SLACK_MESSAGE}"
}