forked from ravi2krishna/lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
31 lines (30 loc) · 1.07 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
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'
}
}
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'
}
}
stage('Release') {
steps {
echo 'Release Nexus'
sh 'rm -rf *.zip'
sh 'cd webapp && zip dist-${BUILD_NUMBER}.zip -r dist'
sh 'cd webapp && curl -v -u $Username:$Password --upload-file dist-${BUILD_NUMBER}.zip http://20.172.187.108:8081/repository/lms/'
}
}
}
}