Skip to content

Commit

Permalink
Flow to setup local environment automated OK
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolman-Freecss committed Oct 16, 2024
1 parent d3079d9 commit 3ca2ea0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/local/.data/Jenkinsfile_spring.xml
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]">
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit 3ca2ea0

Please sign in to comment.