-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow to setup local environment automated OK
- Loading branch information
1 parent
d3079d9
commit 3ca2ea0
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
<flow-definition plugin="[email protected]"> | ||
<description>Pipeline de despliegue con Dockerfile embebido</description> | ||
<description>Deploy pipeline with Docker in local Agent</description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties/> | ||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="[email protected]"> | ||
|
@@ -14,20 +14,21 @@ | |
steps { | ||
git branch: 'master', | ||
url: 'https://github.com/Kolman-Freecss/Hackathon-DataHK01-Spring.git', | ||
credentialsId: 'github-credentials' | ||
credentialsId: 'jenkins-credentials-user' | ||
} | ||
} | ||
stage('Build Image Docker') { | ||
steps { | ||
script { | ||
sh 'docker build -t kf-spring-image .' // Build the Dockerfile in the current directory | ||
bat 'docker pull ubuntu:22.04' | ||
bat 'docker build -t kf-spring-image .' // Build the Dockerfile in the current directory | ||
} | ||
} | ||
} | ||
stage('Deploy container') { | ||
steps { | ||
script { | ||
sh 'docker run -d --name kf-spring -p 8081:8081 kf-spring-image' // Launch the container with the image built | ||
bat 'docker run -d --name kf-spring -p 8081:8081 kf-spring-image' // Launch the container with the image built | ||
} | ||
} | ||
} | ||
|