-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathJenkinsfile
60 lines (51 loc) · 1.79 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
#!/usr/bin/env groovy
node('rhel8'){
stage('Checkout repo') {
deleteDir()
git url: 'https://github.com/redhat-developer/openshift-vsts',
branch: "${BRANCH}"
}
stage('Install requirements') {
def nodeHome = tool 'nodejs-lts'
env.PATH="${env.PATH}:${nodeHome}/bin"
sh "npm run setup"
}
stage('Build') {
sh "npm install"
sh "npm run build"
}
withEnv(['JUNIT_REPORT_PATH=report.xml']) {
stage('Test') {
wrap([$class: 'Xvnc']) {
sh "npm run test:report:ci"
junit '**/test-report.xml'
}
}
}
stage('Package') {
sh "npm run extension:create"
}
if(params.UPLOAD_LOCATION) {
stage('Snapshot') {
def filesToPush = findFiles(glob: '**/*.vsix')
def extensionJson = readJSON file: 'vss-extension.json'
sh "sftp -C ${UPLOAD_LOCATION}/snapshots/openshift-vsts/ <<< \$'put -p \"${filesToPush[0].path}\"'"
}
}
if(publishToMarketPlace.equals('true')){
timeout(time:5, unit:'DAYS') {
input message:'Approve deployment?', submitter: 'jmaury,lstocchi'
}
stage("Publish to Marketplace") {
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) {
def vsix = findFiles(glob: '**/*.vsix')
sh "npm run extension:publish"
}
archive includes:"**/*.vsix"
stage "Promote the build to stable"
def vsix = findFiles(glob: '**/*.vsix')
def extensionJson = readJSON file: 'vss-extension.json'
sh "sftp -C ${UPLOAD_LOCATION}/stable/openshift-vsts/ <<< \$'put -p \"${vsix[0].path}\"'"
}
}
}