Skip to content
Permalink
Browse files

Jenkinsfile: Remove the whole project directory before cloning into it

To ensure it is not polluted with files from a previously cloned
project.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch-si.com>
  • Loading branch information...
sschuberth committed Jul 5, 2019
1 parent 27da8e6 commit e313983d1f64a424cc01693dd5fbc7d7585959ae
Showing with 4 additions and 5 deletions.
  1. +4 −5 Jenkinsfile
@@ -43,11 +43,13 @@ pipeline {
stages {
stage('Clone project') {
steps {
sh 'rm -fr project'

// See https://jenkins.io/doc/pipeline/steps/git/.
checkout([$class: 'GitSCM',
userRemoteConfigs: [[url: params.VCS_URL]],
branches: [[name: "*/${params.VCS_BRANCH}"]],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'project']]
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'project/source']]
])
}
}
@@ -60,8 +62,7 @@ pipeline {

stage('Run ORT analyzer') {
steps {
sh 'rm -fr project/ort/analyzer'
sh 'docker/run.sh "-v $WORKSPACE/project:/project" $LOG_LEVEL analyze -f JSON,YAML -i /project -o /project/ort/analyzer'
sh 'docker/run.sh "-v $WORKSPACE/project:/project" $LOG_LEVEL analyze -f JSON,YAML -i /project/source -o /project/ort/analyzer'
}

post {
@@ -76,7 +77,6 @@ pipeline {

stage('Run ORT scanner') {
steps {
sh 'rm -fr project/ort/scanner'
sh 'docker/run.sh "-v $WORKSPACE/project:/project" $LOG_LEVEL scan -f JSON,YAML -a /project/ort/analyzer/analyzer-result.yml -o /project/ort/scanner'
}

@@ -92,7 +92,6 @@ pipeline {

stage('Run ORT reporter') {
steps {
sh 'rm -fr project/ort/reporter'
sh 'docker/run.sh "-v $WORKSPACE/project:/project" $LOG_LEVEL report -f StaticHTML,WebApp -i /project/ort/scanner/scan-result.yml -o /project/ort/reporter'
}

0 comments on commit e313983

Please sign in to comment.
You can’t perform that action at this time.