-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile
More file actions
43 lines (40 loc) · 1.79 KB
/
JenkinsFile
File metadata and controls
43 lines (40 loc) · 1.79 KB
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
#!/usr/bin/env groovy
import groovy.json.JsonOutput
def notifyRC(text, channel) {
def RCURL = 'https://rocketchat.domain.co.uk/hooks/<scooby-doo>'
def payload = JsonOutput.toJson([text : text,
channel : channel])
sh "curl -X POST --data-urlencode \'payload=${payload}\' ${RCURL}"
}
/**
* ReqA Class description
*/
pipeline {
agent any
stages {
stage('Lint and Zip') {
steps {
/*sh '~/OctopusCLI/Octo pack --version=1.0.$BUILD_NUMBER --id=$JOB_NAME --format=Zip --outFolder=../octopack --overwrite' COMMENTED BECAUSE CANNOT SET DIR TO ZIP*/
sh 'zip -r $JOB_NAME.1.0.$BUILD_NUMBER.zip deployment/'
}
}
stage('Push to Octopus') {
steps {
sh '~/OctopusCLI/Octo push --package $JOB_NAME.1.0.$BUILD_NUMBER.zip --replace-existing --server https://octopus.domain.co.uk/ --apikey $OctoToken --ignoreSslErrors --debug'
sh '~/OctopusCLI/Octo create-release --project $JOB_NAME --version 1.0.$BUILD_NUMBER --packageversion 1.0.$BUILD_NUMBER --server https://octopus.domain.co.uk/ --apikey $OctoToken --ignoreSslErrors --progress'
}
}
/*
stage('Deploy from Octopus') {
steps {
sh '~/OctopusCLI/Octo deploy-release --project $JOB_NAME --version 1.0.$BUILD_NUMBER --packageversion 1.0.$BUILD_NUMBER --server https://octopus.domain.co.uk/ --apikey $OctoToken --ignoreSslErrors --progress'
}
} */
stage('Notify and Cleanup') {
steps {
/* notifyRC("Job '${JOB_NAME}' (${BUILD_NUMBER}) is available in Octopus. Refer to ${BUILD_URL} for details",'#core_infrastructure') */
step([$class: 'WsCleanup'])
}
}
}
}