Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking mail #14

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM schoolofdevops/carts-maven

WORKDIR /opt/carts

COPY . .

RUN mvn package \
&& mv target/carts.jar /run/carts.jar \
&& rm -rf /opt/carts/*

WORKDIR /run

EXPOSE 80

CMD java -jar carts.jar --port=80
59 changes: 59 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pipeline {
agent none
stages {
stage('Build') {
agent {
docker {
image 'schoolofdevops/carts-maven'
}

}
steps {
echo 'Building..'
sh 'mvn compile'
}
}

stage('Test') {
agent {
docker {
image 'schoolofdevops/carts-maven'
}

}
steps {
echo 'Testing'
sh 'mvn test'
}
}

stage('Package') {
agent {
docker {
image 'schoolofdevops/carts-maven'
}

}
steps {
echo 'Packaging....'
sh 'mvn -DskipTests package'
archiveArtifacts '**/target/*.jar'
}
}

stage('docker build and publish') {
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
def dockerImage = docker.build("subbu26/carts:v${env.BUILD_ID}", "./")
dockerImage.push()
dockerImage.push("latest")

}
}

}
}

}
}
1 change: 1 addition & 0 deletions mail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hope triggers mail