-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
54 lines (48 loc) · 1.15 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pipeline {
agent {
dockerfile {
filename 'Dockerfile.build'
args '-u 0:0 -v /var/run/docker.sock:/var/run/docker.sock'
label 'Ubuntu'
}
}
environment {
HOME = '/tmp'
}
stages {
stage('Build') {
steps {
sh 'dotnet restore'
sh 'dotnet clean'
sh 'dotnet build'
}
}
stage('Test') {
steps {
sh 'dotnet test'
}
}
stage('Package') {
steps {
sh "docker build -t rakeshhcl11/myproject:latest -f ./MyProject/Dockerfile ./"
sh "docker login -u rakeshhcl11 -p Auss13******"
sh "docker push rakeshhcl11/myproject:latest"
}
}
stage('Analysis') {
steps {
sh "dotnet /sonar-scanner/SonarScanner.MSBuild.dll begin /k:dotnet-customer-ms /d:sonar.host.url='http://13.234.33.89:9000' /d:sonar.login='c87723110deab90be1520f7554dd3b85b7b82427'"
sh "dotnet build"
sh "dotnet /sonar-scanner/SonarScanner.MSBuild.dll end /d:sonar.login='c87723110deab90be1520f7554dd3b85b7b82427'"
}
}
}
post {
always {
sh "chmod -R 777 ./*"
sh "chmod -R 777 ./.*"
deleteDir()
cleanWs()
}
}
}