This repository has been archived by the owner on May 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding badges to readme, jenkinsfile, and updating sonarcloud org (#19)
Signed-off-by: bfitzpat@redhat.com <bfitzpat@redhat.com>
- Loading branch information
Showing
3 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/usr/bin/env groovy | ||
|
||
node('rhel7'){ | ||
stage('Checkout repo') { | ||
deleteDir() | ||
git url: 'https://github.com/redhat-developer/vscode-didact' | ||
} | ||
|
||
stage('Install requirements') { | ||
def nodeHome = tool 'nodejs-8.11.1' | ||
env.PATH="${env.PATH}:${nodeHome}/bin" | ||
sh "npm install -g typescript vsce" | ||
} | ||
|
||
stage('Build') { | ||
env.JAVA_HOME="${tool 'openjdk-1.8'}" | ||
env.PATH="${env.JAVA_HOME}/bin:${env.PATH}" | ||
sh "java -version" | ||
|
||
sh "npm install --ignore-scripts" | ||
sh "npm install" | ||
sh "npm run vscode:prepublish" | ||
} | ||
|
||
withEnv(['JUNIT_REPORT_PATH=report.xml']) { | ||
stage('Test') { | ||
wrap([$class: 'Xvnc']) { | ||
sh "npm test --silent" | ||
junit 'report.xml' | ||
} | ||
} | ||
} | ||
|
||
stage('Package') { | ||
def packageJson = readJSON file: 'package.json' | ||
sh "vsce package -o vscode-didact-${packageJson.version}-${env.BUILD_NUMBER}.vsix" | ||
} | ||
|
||
if(params.UPLOAD_LOCATION) { | ||
stage('Snapshot') { | ||
def filesToPush = findFiles(glob: '**.vsix') | ||
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${filesToPush[0].path} ${UPLOAD_LOCATION}/snapshots/vscode-didact/" | ||
stash name:'vsix', includes:filesToPush[0].path | ||
} | ||
} | ||
} | ||
|
||
node('rhel7'){ | ||
if(publishToMarketPlace.equals('true')){ | ||
timeout(time:5, unit:'DAYS') { | ||
input message:'Approve deployment?', submitter: 'apupier,lheinema,bfitzpat,tsedmik,djelinek' | ||
} | ||
|
||
stage("Publish to Marketplace") { | ||
unstash 'vsix' | ||
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) { | ||
def vsix = findFiles(glob: '**.vsix') | ||
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix[0].path}" | ||
} | ||
archive includes:"**.vsix" | ||
|
||
stage "Promote the build to stable" | ||
def vsix = findFiles(glob: '**.vsix') | ||
sh "rsync -Pzrlt --rsh=ssh --protocol=28 ${vsix[0].path} ${UPLOAD_LOCATION}/stable/vscode-didact/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters