-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
61 lines (47 loc) · 1.57 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
pipeline {
agent { label 'ec2Agent' }
tools {nodejs "node16" }
environment {
NODE_ENV='production'
}
stages {
stage('source') {
steps {
checkout scm
sh 'ls -la'
}
}
stage('build') {
environment{
NODE_ENV='StagingGitTest'
}
steps {
echo NODE_ENV
// withCredentials([string(credentialsId: 'e8f8ff88-49e0-433a-928d-36a518cd30d6', variable: 'secver')]) {
// // some block
// echo secver
// }
sh 'npm install'
}
}
// stage('saveArtifact') {
// steps {
// archiveArtifacts artifacts: '**', followSymlinks: false
// }
// }
}
post {
always {
echo 'This will always run'
}
success {
echo 'This will run only if successful'
}
failure {
mail bcc: '', body: "<b>Example</b><br>Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "ERROR CI: Project name -> ${env.JOB_NAME}", to: "[email protected]";
}
unstable {
echo 'This will run only if the run was marked as unstable'
}
}
}