forked from Ismailalkouz94/Issue-Tracking-System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
63 lines (57 loc) · 1.48 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline {
agent any
tools {
jdk 'jdk'
maven '3.8.4'
}
environment
{
PROJECT = "its"
}
stages {
stage("build project") {
steps {
echo "Java VERSION"
sh 'java -version'
echo "Maven VERSION"
sh 'mvn -version'
echo 'building project...'
sh "(cd Back-End/ ; mvn clean)"
sh "(cd Back-End/ ; mvn install)"
}
}
stage('Build Docker Image'){
steps
{
sh "(cd Back-End/ ; docker build . -t ${PROJECT}:latest)"
}
}
stage('Up Docker Compose'){
steps
{
sh "(cd Back-End/ ; docker-compose up --detach)"
}
}
// stage('Push Image to Docker Hub'){
// steps
// {
// sh "docker login -u=ismailkouz -p=55a127ca-98c5-4a5c-a024-cdb25b9d597c"
// sh 'docker tag ${PROJECT} ismailkouz/${PROJECT}:latest'
// sh 'docker push ismailkouz/${PROJECT}:latest'
// }
// }
// stage('Deploy to Kubernetes Cluster'){
// steps
// {
// sh "(cd Back-End/ ; kubectl apply -f k8s-app-deployment.yaml)"
// }
// }
}
post
{
always
{
sh "rm -rf /var/jenkins_home/workspace/${PROJECT}/*"
}
}
}