forked from inspirit941/todo-with-cicd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
48 lines (42 loc) · 1.15 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
pipeline {
agent any
options {
timeout(time: 1, unit: 'HOURS')
}
environment {
SOURCECODE_JENKINS_CREDENTIAL_ID = 'credentials'
SOURCE_CODE_URL = 'https://github.com/m2ga-azure/jenkinsfile-runner-example-repo.git'
RELEASE_BRANCH = 'master'
}
stages {
stage('init') {
steps {
echo 'clear'
sh "ls -al"
echo 'git branch'
}
}
stage('clone') {
steps {
git url: SOURCE_CODE_URL, branch: RELEASE_BRANCH, credentialsId: SOURCECODE_JENKINS_CREDENTIAL_ID
sh "ls -al"
}
}
stage('frontend dockerizing') {
steps {
sh "docker build -t todo/frontend ./frontend"
}
}
stage('backend dockerizing') {
steps {
sh "pwd"
dir("./backend"){
sh "pwd"
sh "./gradlew clean"
sh "./gradlew bootJar"
sh "docker build -t todo/backend ."
}
}
}
}
}