-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile
More file actions
72 lines (66 loc) · 1.94 KB
/
Jenkinsfile
File metadata and controls
72 lines (66 loc) · 1.94 KB
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
64
65
66
67
68
69
70
71
72
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
}
environment {
SOURCECODE_JENKINS_CREDENTIAL_ID = 'donghun'
SOURCE_CODE_URL = 'https://lab.ssafy.com/s08-final/S08P31B209.git'
RELEASE_BRANCH = 'release-client'
}
stages {
stage('Clone') {
steps {
git url: "$SOURCE_CODE_URL",
branch: "$RELEASE_BRANCH",
credentialsId: "$SOURCECODE_JENKINS_CREDENTIAL_ID"
sh "ls -al"
}
}
stage('Dependencies install') {
when {
changeset "front/package.json"
}
steps {
dir('front') {
nodejs(nodeJSInstallationName: 'NodeJS18') {
sh "npm install --legacy-peer-deps"
}
}
}
}
stage('Build') {
steps {
dir('front') {
nodejs(nodeJSInstallationName: 'NodeJS18') {
sh "npm run build"
}
}
}
}
stage('Dockerizing') {
steps {
sh "pwd"
sh "docker build --no-cache -t front ./front"
}
}
stage('Deploy') {
steps{
sh "pwd"
sh "docker-compose -f docker-compose-client.yml up -d --build"
sh "docker ps"
sh '''
docker exec docdoc_client_client_1 sed -i 's/location \\/ {/location \\/ {\\n\\t\\ttry_files \\$uri \\$uri\\/ \\/index.html;/g' /etc/nginx/conf.d/default.conf
'''
}
post {
success {
echo "docker-compose success"
}
failure {
echo "docker-compose failed"
}
}
}
}
}