Skip to content

Commit 5f8002a

Browse files
Maclean Dev OpsMaclean Dev Ops
authored andcommitted
build infra
1 parent fd2c11a commit 5f8002a

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

jenkinsfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
pipeline {
2+
agent any
3+
4+
stages {
5+
stage('Compile') {
6+
steps {
7+
echo "compiling stage"
8+
sh 'mvn compile'
9+
}
10+
}
11+
12+
stage('Test') {
13+
steps {
14+
echo "testing stage"
15+
sh 'mvn test'
16+
}
17+
}
18+
19+
stage('Package') {
20+
steps {
21+
echo "Packing application"
22+
sh 'mvn package'
23+
}
24+
25+
post {
26+
success {
27+
echo 'Package successful!'
28+
}
29+
}
30+
}
31+
stage('Docker build') {
32+
steps {
33+
echo "building image"
34+
sh 'docker build -t javapp:${BUILD_NUMBER}'
35+
}
36+
}
37+
stage('Docker log in') {
38+
steps {
39+
echo "Logging into docker"
40+
sh 'docker login -u maclean23'
41+
sh 'dckr_pat_xiWXRPMsc9Xfye1df9n_37Y5RQs'
42+
}
43+
}
44+
stage(' Docker Push ') {
45+
steps {
46+
echo " Pushing image to Docker"
47+
sh 'docker push javapp:${BUILD_NUMBER}'
48+
post {
49+
success {
50+
echo 'PUSH SUCCESSFUL'
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)