Skip to content

Commit

Permalink
creds
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi2krishna committed May 12, 2023
1 parent 43c77ff commit eb45999
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
pipeline {
agent any
environment {
// More detail:
// https://jenkins.io/doc/book/pipeline/jenkinsfile/#usernames-and-passwords
NEXUS_CRED = credentials('nexus')
}

stages {
stage('Build') {
steps {
echo 'Building..'
sh 'cd webapp && npm install && npm run build'
//sh 'cd webapp && npm install && npm run build'
}
}
stage('Test') {
steps {
echo 'Testing..'
sh 'cd webapp && sudo docker container run --rm -e SONAR_HOST_URL="http://20.172.187.108:9000" -e SONAR_LOGIN="sqp_cae41e62e13793ff17d58483fb6fb82602fe2b48" -v ".:/usr/src" sonarsource/sonar-scanner-cli -Dsonar.projectKey=lms'
//sh 'cd webapp && sudo docker container run --rm -e SONAR_HOST_URL="http://20.172.187.108:9000" -e SONAR_LOGIN="sqp_cae41e62e13793ff17d58483fb6fb82602fe2b48" -v ".:/usr/src" sonarsource/sonar-scanner-cli -Dsonar.projectKey=lms'
}
}
stage('Release') {
steps {
echo 'Release Nexus'
sh 'cd webapp && zip dist-${BUILD_NUMBER}.zip -r dist'
sh 'cd webapp && curl -v -u admin:Admin123* --upload-file dist-${BUILD_NUMBER}.zip http://20.172.187.108:8081/repository/lms/'
sh 'cd webapp && curl -v -u $Username:$Password --upload-file dist-${BUILD_NUMBER}.zip http://20.172.187.108:8081/repository/lms/'
}
}
}
Expand Down

0 comments on commit eb45999

Please sign in to comment.