Skip to content

Commit

Permalink
For Jenkins CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hakdogan committed Nov 30, 2017
1 parent 719a70e commit 4cb4e9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ node {
pushToImage(CONTAINER_NAME, USERNAME, PASSWORD)
}
}

stage('Run App'){
runApp(CONTAINER_NAME, DOCKER_HUB_USER, HTTP_PORT)
}

}

def imagePrune(containerName){
Expand All @@ -63,10 +58,4 @@ def pushToImage(containerName, dockerUser, dockerPassword){
sh "docker tag $containerName:latest $dockerUser/$containerName:latest"
sh "docker push $dockerUser/$containerName:latest"
echo "Image push complete"
}

def runApp(containerName, dockerHubUser, httpPort){
sh "docker pull $dockerHubUser/$containerName"
sh "docker run -d --rm -p $httpPort:$httpPort --name $containerName $dockerHubUser/$containerName:latest"
echo "Application started on port: $httpPort (http)"
}
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@
</dependency>
<!-- Test related ends-->

<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.7.1</version>
<type>maven-plugin</type>
</dependency>

</dependencies>

<build>
Expand Down

0 comments on commit 4cb4e9f

Please sign in to comment.