Skip to content
Open
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
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ def CONTAINER_NAME = "calculator"
def ENV_NAME = getEnvName(env.BRANCH_NAME)
def CONTAINER_TAG = getTag(env.BUILD_NUMBER, env.BRANCH_NAME)
def HTTP_PORT = getHTTPPort(env.BRANCH_NAME)
def EMAIL_RECIPIENTS = "[email protected]"

def EMAIL_RECIPIENTS = "[email protected]"

// les stages restent des étapes
node {
try {
// Dans initializer on récupère juste le dockerLatest et Maven puis on l'ajoute au path
stage('Initialize') {
def dockerHome = tool 'DockerLatest'
def mavenHome = tool 'MavenLatest'
Expand Down Expand Up @@ -83,7 +84,7 @@ def pushToImage(containerName, tag, dockerUser, dockerPassword) {
}

def runApp(containerName, tag, dockerHubUser, httpPort, envName) {
sh "docker pull $dockerHubUser/$containerName"
sh "docker pull $dockerHubUser/$containerName:$tag"
sh "docker run --rm --env SPRING_ACTIVE_PROFILES=$envName -d -p $httpPort:$httpPort --name $containerName $dockerHubUser/$containerName:$tag"
echo "Application started on port: ${httpPort} (http)"
}
Expand Down