-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
52 lines (47 loc) · 1.36 KB
/
Jenkinsfile
File metadata and controls
52 lines (47 loc) · 1.36 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
pipeline {
agent {
docker {
image 'jenkins/jenkins:lts'
args '-v /var/run/docker.sock:/var/run/docker.sock'
}
}
stages {
stage('Checkout') {
steps {
git branch: 'infra',
credentialsId: 'howdoilook',
url: 'https://lab.ssafy.com/s09-webmobile1-sub2/S09P12B304.git'
}
}
stage('Build Frontend') {
steps {
dir('front') {
sh 'apt-get update && apt-get install -y npm'
sh 'npm install --force'
sh 'npm run build'
sh 'docker build -t parkseyun/howdoilook:front .'
}
}
}
stage('Build Backend') {
steps {
dir('Back') {
sh './gradlew clean build'
sh 'docker build -t parkseyun/howdoilook:back .'
}
}
}
stage('Docker Push') {
steps {
sh 'docker push parkseyun/howdoilook:front'
sh 'docker push parkseyun/howdoilook:back'
}
}
stage('Deploy') {
steps {
echo 'Deploying services...'
sh 'docker-compose up -d front back'
}
}
}
}