forked from openMF/web-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsFile
63 lines (54 loc) · 1.31 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
pipeline {
agent any
environment {
NODE_VERSION = '18.4.0' // Set the Node.js version
}
stages {
stage('Checkout') {
steps {
git branch: 'develop', url: 'https://github.com/openMF/web-app.git'
}
}
stage('Setup Node.js') {
steps {
script {
def nodeHome = tool name: "NodeJS ${NODE_VERSION}", type: 'jenkins.plugins.nodejs.tools.NodeJSInstallation'
env.PATH = "${nodeHome}/bin:${env.PATH}"
}
}
}
stage('Install Dependencies') {
steps {
sh 'npm install'
}
}
stage('Lint') {
steps {
sh 'npm run lint'
}
}
stage('Run Tests') {
steps {
sh 'npm test'
}
}
stage('Build') {
steps {
sh 'npm run build'
}
}
stage('Archive Artifacts') {
steps {
archiveArtifacts artifacts: 'dist/**', fingerprint: true
}
}
}
post {
success {
echo 'Pipeline completed successfully!'
}
failure {
echo 'Pipeline failed!'
}
}
}