-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
75 lines (65 loc) · 1.92 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline {
agent {
label 'Slave4_Induccion'
}
triggers {
pollSCM('* * * * *')
}
tools {
jdk 'JDK8_Centos' //Verisión preinstalada en la Configuración del Master
}
stages {
stage('Checkout'){
steps{
echo "------------>Checkout<------------"
checkout([
$class: 'GitSCM',
branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false,
extensions: [],
gitTool: 'Default',
submoduleCfg: [],
userRemoteConfigs: [[
credentialsId: 'GitHub_anderson.camacho',
url:'https://github.com/anderson-camacho/Cinema_FrontEnd'
]]
])
}
}
stage('Install') {
steps {
sh 'npm install'
}
}
stage('Tests') {
steps {
sh 'npm run test'
}
}
stage('Sonar Scanner Coverage') {
steps{
echo '------------>Análisis de código estático<------------'
withSonarQubeEnv('Sonar') {
sh "${tool name: 'SonarScanner', type:'hudson.plugins.sonar.SonarRunnerInstallation'}/bin/sonar-scanner"
}
}
}
stage('Build'){
steps {
sh 'ng build --prod '
}
}
}
post{
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
}
failure {
echo 'This will run only if failed'
mail (to: '[email protected]', subject: "Failed Pipeline:${currentBuild.fullDisplayName}",body: "Something is wrong with ${env.BUILD_URL}")
}
}
}