-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
40 lines (30 loc) · 975 Bytes
/
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
32
33
34
35
36
37
38
39
40
node {
environment {
CI = 'true'
}
stage('checkout') {
echo 'Copying...'
git 'https://github.com/deathsh0ot/AngTestApp.git'
}
stage('install modules') {
echo 'installing modules...'
sh 'npm install'
}
stage('Build') {
echo 'Building...'
sh 'ng build --prod'
}
stage('SonarQube analysis') {
def scannerHome = tool 'sonar_scanner';
withSonarQubeEnv('SonarQ') {
sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=angularTestapp"
}
}
stage("building image") {
sh ' docker build -t angapp ${WORKSPACE}/ '
}
stage("run") {
sh 'docker rm -f frontEnd || true'
sh 'docker run -d --name frontEnd -p 4201:4200 angapp'
}
}