-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile
54 lines (54 loc) · 1.63 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
pipeline {
agent any
tools {
nodejs "node16"
}
stages {
stage('prepare') {
steps {
echo 'prepare'
git branch: "main", credentialsId: "github_access_token_chanhyuk", url: 'https://github.com/Park-Systems-web/Nanoscientific-Symposium.git'
sh 'ls -al'
}
}
stage('client-build') {
steps {
dir('client'){
sh '''
ls -al
npm install
echo "REACT_APP_S3_ACCESS_KEY=${REACT_APP_S3_ACCESS_KEY_EXT}\nREACT_APP_S3_SECRET_ACCESS_KEY=${REACT_APP_S3_SECRET_ACCESS_KEY_EXT}\nREACT_APP_PAYPAL_CLIENT_ID=${REACT_APP_PAYPAL_CLIENT_ID_EXT}" >> .env.production
CI=false npm run build
'''
}
}
}
stage('client-deploy') {
steps {
dir('client'){
sh '''
ls -al
sudo rm -rf /home/ubuntu/client/dist
sudo cp -r ./dist /home/ubuntu/client/dist
'''
}
}
}
stage('server-deploy') {
steps {
dir('server'){
sh '''
ls -al
npm install
sudo cp -r . /home/ubuntu/server
'''
}
}
}
stage('cleanup-ws') {
steps{
cleanWs()
}
}
}
}