Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Flask_App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LAMRINI Houda
Flask_App
Commits
77aff8a2
Commit
77aff8a2
authored
5 months ago
by
LAMRINI Houda
Browse files
Options
Downloads
Patches
Plain Diff
gitlab-ci update
parent
70c5473c
No related branches found
No related tags found
No related merge requests found
Pipeline
#47240
failed
5 months ago
Stage: build_push
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+5
-33
5 additions, 33 deletions
.gitlab-ci.yml
with
5 additions
and
33 deletions
.gitlab-ci.yml
+
5
−
33
View file @
77aff8a2
# Utilise l'image Docker appropriée
image
:
docker:19.03.1
image
:
docker:19.03.1
# Le service Docker-in-Docker avec la version spécifiée
services
:
services
:
-
docker:19.03.1-dind
-
name
:
docker:19.03.1-dind
alias
:
docker
variables
:
variables
:
# Définir les variables nécessaires pour Docker-in-Docker
DOCKER_DRIVER
:
overlay2
DOCKER_DRIVER
:
overlay2
DOCKER_TLS_CERTDIR
:
"
/certs"
DOCKER_TLS_CERTDIR
:
"
/certs"
DOCKER_HOST
:
"
tcp://docker:2375"
# Spécifie l'hôte Docker à utiliser
DOCKER_HOST
:
"
tcp://docker:2375"
# Phases du pipeline
stages
:
stages
:
-
build_push
-
build_push
-
test
-
deploy
# Connexion à Docker Registry
before_script
:
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $CI_REGISTRY
# Étape de construction et de push de l'image Docker
build-push-image
:
build-push-image
:
stage
:
build_push
stage
:
build_push
tags
:
-
dind
script
:
script
:
-
docker build . --tag $CI_REGISTRY/gitlab-ci-dind-example:latest
-
docker build . --tag $CI_REGISTRY/my-image:latest
-
docker push $CI_REGISTRY/gitlab-ci-dind-example:latest
-
docker push $CI_REGISTRY/my-image:latest
# Étape de test de l'image construite (à personnaliser selon tes besoins)
test-image
:
stage
:
test
tags
:
-
dind
script
:
-
echo "Insérer des tests d'API ici !"
# Remplace par des tests réels
# Étape de déploiement (exemple d'usage avec Ansible)
deploy-2-dev
:
stage
:
deploy
tags
:
-
dind
script
:
-
echo "Tu devrais utiliser Ansible ici !"
# Remplace par ta logique de déploiement
environment
:
name
:
dev
url
:
https://dev.example.com
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