-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
33 lines (30 loc) · 1.04 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
pipeline {
agent any
tools {nodejs "nodejs"}
stages {
stage('Deploy for production') {
when {
branch 'main'
}
steps {
script {
sh '''
ssh -o StrictHostKeyChecking=no [email protected] "cd /home/shira-production/shira-private ; git fetch --all ; git reset --hard origin/main; export PATH=/root/.nvm/versions/node/v16.20.0/bin:$PATH ; npm install ; npm run build"
'''
}
}
}
stage ('Deploy for staging') {
when {
branch 'development'
}
steps {
script {
sh '''
ssh -o StrictHostKeyChecking=no [email protected] "cd /home/shira-staging/shira-private ; git fetch --all ; git reset --hard origin/development; export PATH=/root/.nvm/versions/node/v16.17.1/bin:$PATH ; npm install ; npm run build"
'''
}
}
}
}
}