Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Démonstrateur CI Maven
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
DnumArchi
Démonstrateur CI Maven
Commits
fa9528bc
Commit
fa9528bc
authored
3 years ago
by
Patrick Dos Santos
Browse files
Options
Downloads
Patches
Plain Diff
Création d'un placeholder pour le nom de l'image Docker a déployer lors du CD
parent
dccd3006
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+7
-3
7 additions, 3 deletions
.gitlab-ci.yml
deploy/deployment.yaml
+1
-1
1 addition, 1 deletion
deploy/deployment.yaml
with
8 additions
and
4 deletions
.gitlab-ci.yml
+
7
−
3
View file @
fa9528bc
...
...
@@ -10,8 +10,6 @@
# Image Docker Maven par défaut
default
:
image
:
maven:3.8.3-eclipse-temurin-11
tags
:
-
runner-externe
# Définition des étapes du pipeline
stages
:
...
...
@@ -211,16 +209,22 @@ deploy-services:
when
:
never
-
changes
:
-
deploy/service.yaml
# On souhaite utiliser la configuration du runner-externe pour déployer
tags
:
-
runner-externe
deploy-app
:
image
:
bitnami/kubectl
stage
:
deploy
script
:
-
sed -i 's/<
VERSION>/'
${CI_COMMIT_TAG}'/g' deploy/deployment.yaml
-
sed -i 's/<
IMAGE_PATH>:<VERSION>/'${CI_REGISTRY_IMAGE}:
${CI_COMMIT_TAG}'/g' deploy/deployment.yaml
-
kubectl apply -f deploy/deployment.yaml
rules
:
# Lancement de l'étape lors de la création d'un tag, d'une merge request ou d'un pipeline programmé
-
if
:
$CI_COMMIT_TAG !=
null
# On souhaite utiliser la configuration du runner-externe pour déployer
tags
:
-
runner-externe
# Fin
#======================================
This diff is collapsed.
Click to expand it.
deploy/deployment.yaml
+
1
−
1
View file @
fa9528bc
...
...
@@ -18,7 +18,7 @@ spec:
containers
:
# Set here your Gitlab Registry address
-
name
:
date-webapp
image
:
registry.gitlab-forge.din.developpement-durable.gouv.fr/pub/snumarchi/ci-maven-demo
:<VERSION>
image
:
<IMAGE_PATH>
:<VERSION>
ports
:
-
containerPort
:
8080
restartPolicy
:
Always
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment