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

Dev #141

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Dev #141

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM tomcat:8
# Take the war and copy to webapps of tomcat
COPY target/*.war /usr/local/tomcat/webapps/
# Added for jenkins demo
COPY target/*.war /usr/local/tomcat/webapps
45 changes: 23 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
node{
stage('SCM Checkout'){
git 'https://github.com/javahometech/my-app'
}
stage('Compile-Package'){
// Get maven home path
def mvnHome = tool name: 'maven-3', type: 'maven'
sh "${mvnHome}/bin/mvn package"
}
stage('Email Notification'){
mail bcc: '', body: '''Hi Welcome to jenkins email alerts
Thanks
Hari''', cc: '', from: '', replyTo: '', subject: 'Jenkins Job', to: '[email protected]'
}
stage('Slack Notification'){
slackSend baseUrl: 'https://hooks.slack.com/services/',
channel: '#jenkins-pipeline-demo',
color: 'good',
message: 'Welcome to Jenkins, Slack!',
teamDomain: 'javahomecloud',
tokenCredentialId: 'slack-demo'
}
@Library('app-libs') _
pipeline{
agent any
stages{

stage("Maven Build"){
steps{
sh 'mvn clean package'
sh 'mv target/myweb*.war target/myweb.war'
}
}

stage("Deploy to Tomcat Development"){
steps{
tomcatDeploy("172.31.46.32","tomcat-dev","myweb")
}
}
}
post {
always {
cleanWs()
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>in.javahome</groupId>
<artifactId>myweb</artifactId>
<packaging>war</packaging>
<version>0.0.3</version>
<version>0.0.4</version>
<name>my-app</name>

<url>http://maven.apache.org</url>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/in/javahome/myweb/controller/Calculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ public int add(int i, int j){
public int multiply(int i, int j){
return i*j;
}
public void sonarDemo(){
String name = null;
name.toString();
}
}
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<body>

<div class="container-fluid">
<h1>Javahome App - 0.0.3</h1>
<h1 style="color: green">Java Home App!!!!</h1>
</div>

</body>
Expand Down