-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
62 lines (57 loc) · 1.36 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
pipeline {
agent any
environment{
NETLIFY_SITE_ID = '22efd7a8-63fc-45d5-a561-c633de352045'
NETLIFY_AUTH_TOKEN = credentials('netlify-token')
}
stages {
stage('Build'){
agent {
docker{
image 'node:22'
args '-u root:root'
reuseNode true
}
}
steps{
sh '''
npm ci
npm run build
ls -la
'''
}
}
stage('Test'){
agent {
docker{
image 'node:22'
args '-u root:root'
reuseNode true
}
}
steps{
sh '''
test -f dist/index.html
npm run test
'''
}
}
stage('Deploy'){
agent {
docker{
image 'node:22'
args '-u root:root'
reuseNode true
}
}
steps{
sh '''
npm install netlify-cli -g
netlify --version
netlify status
netlify deploy --dir=dist --prod
'''
}
}
}
}