-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
42 lines (34 loc) ยท 1008 Bytes
/
Jenkinsfile
File metadata and controls
42 lines (34 loc) ยท 1008 Bytes
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
pipeline {
agent any
environment {
COMPOSE_FILE = 'docker-compose.yml'
}
stages {
stage('Checkout') {
steps {
echo '๐ฆ Git ์ ์ฅ์์์ ์ฝ๋ ์ฒดํฌ์์ ์ค...'
checkout scm
}
}
stage('Build & Deploy with Docker Compose') {
steps {
echo '๐ Jenkins์์ ํ๊ฒฝ ๋ณ์ ์ฃผ์
ํ์ธ ์ค...'
sh 'echo $DB_URL && echo $DB_USERNAME && echo $DB_PASSWORD'
echo '๐งน ๊ธฐ์กด ์ปจํ
์ด๋ ๋ฐ ์ค๋ธ์ ํธ ์ ๋ฆฌ ์ค...'
sh 'docker compose -f $COMPOSE_FILE down --remove-orphans || true'
echo '๐๏ธ ์ ์ฐ๋ Docker ์ด๋ฏธ์ง ์ ๋ฆฌ ์ค...'
sh 'docker image prune -af || true' // ์ด๋ฏธ์ง๊น์ง ์น ์ ๋ฆฌ (์ ํ์ )
echo '๐ ์ปจํ
์ด๋ ๋น๋ ๋ฐ ์ฌ์์ ์ค...'
sh 'docker compose -f $COMPOSE_FILE up -d --build'
}
}
}
post {
success {
echo 'โ
๋ฐฐํฌ ์ฑ๊ณต!'
}
failure {
echo 'โ ๋ฐฐํฌ ์คํจ...'
}
}
}