-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
43 lines (42 loc) · 1.16 KB
/
Copy pathJenkinsfile
File metadata and controls
43 lines (42 loc) · 1.16 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
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git credentialsId: 'gitub-access-token',
branch: 'test',
url: 'https://github.com/homealone-front/backend'
}
}
stage('Build') {
steps {
echo 'Building...'
sh 'chmod +x ./gradlew'
sh './gradlew clean build'
}
}
stage('Archive') {
steps {
echo 'Archiving...'
archiveArtifacts artifacts: '**/build/libs/**/*.jar', fingerprint: true
}
}
stage("Deploy to VM") {
steps {
script {
sshagent(credentials: ['homealone-ec2']) {
sh 'scp -o StrictHostKeyChecking=no -r build/libs/* ubuntu@home-alone.site:/home/ubuntu/backend'
}
}
}
}
stage("Build Docker Image") {
steps {
script {
// Docker 이미지 빌드
sh 'docker build --no-cache -t homealone .'
}
}
}
}
}