Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
smirnovaae committed Sep 28, 2023
1 parent 3b2ef7d commit 54b8d04
Showing 1 changed file with 64 additions and 64 deletions.
128 changes: 64 additions & 64 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,70 +78,70 @@ pipeline {
}
}

stage('Run unit and integration tests') {

steps {
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
sh '''
export AB2D_EFS_MOUNT="${AB2D_HOME}"
mvn -s settings.xml -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} test -pl common,job,coverage,api,worker
'''
}
}
}

stage('Run e2e-bfd-test') {

steps {

withCredentials([file(credentialsId: 'SANDBOX_BFD_KEYSTORE', variable: 'SANDBOX_BFD_KEYSTORE'),
string(credentialsId: 'SANDBOX_BFD_KEYSTORE_PASSWORD', variable: 'AB2D_BFD_KEYSTORE_PASSWORD'),
usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {

sh '''
export AB2D_BFD_KEYSTORE_LOCATION="$WORKSPACE/opt/ab2d/ab2d_bfd_keystore"
cp $SANDBOX_BFD_KEYSTORE $AB2D_BFD_KEYSTORE_LOCATION
test -f $AB2D_BFD_KEYSTORE_LOCATION && echo "created keystore file"
chmod 666 $AB2D_BFD_KEYSTORE_LOCATION
ls -la $AB2D_BFD_KEYSTORE_LOCATION
export AB2D_V2_ENABLED=true
mvn test -s settings.xml -pl e2e-bfd-test -am -Dtest=EndToEndBfdTests -DfailIfNoTests=false -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}
'''
}
}
}
stage('SonarQube Analysis') {
steps {
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
git branch: 'master', credentialsId: 'GITHUB_AB2D_JENKINS_PAT', url: env.GIT_URL
git branch: env.BRANCH_NAME, credentialsId: 'GITHUB_AB2D_JENKINS_PAT', url: env.GIT_URL
// Automatically saves the an id for the SonarQube build
withSonarQubeEnv('CMSSonar') {
sh '''
mvn -s settings.xml sonar:sonar -Dsonar.projectKey=ab2d-project -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}
'''
}
}
}
}

// New Way in declarative pipeline
stage("Quality Gate") {
options {
timeout(time: 10, unit: 'MINUTES')
}
steps {
// Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails
// true = set pipeline to UNSTABLE, false = don't
waitForQualityGate abortPipeline: true
}
}
// stage('Run unit and integration tests') {
//
// steps {
// withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
// sh '''
// export AB2D_EFS_MOUNT="${AB2D_HOME}"
// mvn -s settings.xml -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL} test -pl common,job,coverage,api,worker
// '''
// }
// }
// }

// stage('Run e2e-bfd-test') {
//
// steps {
//
// withCredentials([file(credentialsId: 'SANDBOX_BFD_KEYSTORE', variable: 'SANDBOX_BFD_KEYSTORE'),
// string(credentialsId: 'SANDBOX_BFD_KEYSTORE_PASSWORD', variable: 'AB2D_BFD_KEYSTORE_PASSWORD'),
// usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
//
// sh '''
// export AB2D_BFD_KEYSTORE_LOCATION="$WORKSPACE/opt/ab2d/ab2d_bfd_keystore"
//
// cp $SANDBOX_BFD_KEYSTORE $AB2D_BFD_KEYSTORE_LOCATION
//
// test -f $AB2D_BFD_KEYSTORE_LOCATION && echo "created keystore file"
//
// chmod 666 $AB2D_BFD_KEYSTORE_LOCATION
//
// ls -la $AB2D_BFD_KEYSTORE_LOCATION
//
// export AB2D_V2_ENABLED=true
//
// mvn test -s settings.xml -pl e2e-bfd-test -am -Dtest=EndToEndBfdTests -DfailIfNoTests=false -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}
// '''
// }
// }
// }
// stage('SonarQube Analysis') {
// steps {
// withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
// git branch: 'master', credentialsId: 'GITHUB_AB2D_JENKINS_PAT', url: env.GIT_URL
// git branch: env.BRANCH_NAME, credentialsId: 'GITHUB_AB2D_JENKINS_PAT', url: env.GIT_URL
// // Automatically saves the an id for the SonarQube build
// withSonarQubeEnv('CMSSonar') {
// sh '''
// mvn -s settings.xml sonar:sonar -Dsonar.projectKey=ab2d-project -DskipTests -Dusername=${ARTIFACTORY_USER} -Dpassword=${ARTIFACTORY_PASSWORD} -Drepository_url=${ARTIFACTORY_URL}
// '''
// }
// }
// }
// }
//
// // New Way in declarative pipeline
// stage("Quality Gate") {
// options {
// timeout(time: 10, unit: 'MINUTES')
// }
// steps {
// // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails
// // true = set pipeline to UNSTABLE, false = don't
// waitForQualityGate abortPipeline: true
// }
// }


stage('Run e2e-test') {
Expand Down

0 comments on commit 54b8d04

Please sign in to comment.