Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
devops_mohi
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
MENACER Mohamed
devops_mohi
Commits
914912ac
Commit
914912ac
authored
3 months ago
by
MENACER Mohamed
Browse files
Options
Downloads
Patches
Plain Diff
test10
parent
0ce8d983
No related branches found
No related tags found
1 merge request
!4
Br1
Pipeline
#47533
failed
3 months ago
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+33
-19
33 additions, 19 deletions
.gitlab-ci.yml
with
33 additions
and
19 deletions
.gitlab-ci.yml
+
33
−
19
View file @
914912ac
image
:
docker:26.1
# Utilisation de Docker stable
image
:
docker:latest
variables
:
DOCKER_HOST
:
unix:///var/run/docker.sock
# ✅ Utilisation du Docker du runner
PHP_VERSION
:
"
8.2"
COMPOSER_CACHE_DIR
:
"
$CI_PROJECT_DIR/var/cache/composer"
# Définition des stages
stages
:
stages
:
-
build
-
build
-
test
-
test
-
deploy
before_script
:
# Variables d'environnement, si nécessaires pour Docker Compose
-
apk add --no-cache bash git unzip curl docker-compose
variables
:
-
docker version
# ✅ Vérifie si Docker est bien accessible
DOCKER_DRIVER
:
overlay2
-
docker-compose version
# ✅ Vérifie si Docker Compose fonctionne
COMPOSE_FILE
:
"
docker-compose.yml"
# Job pour construire l'image Docker avec Docker Compose
build
:
build
:
stage
:
build
stage
:
build
services
:
-
docker:19.03.12-dind
script
:
script
:
-
docker-compose up -d
# ✅ Démarre les services
-
docker-compose -f $COMPOSE_FILE build
-
docker-compose exec php composer install --no-interaction --prefer-dist
-
docker-compose -f $COMPOSE_FILE up -d
artifacts
:
paths
:
-
vendor/
# Job de tests
test
:
test
:
stage
:
test
stage
:
test
services
:
-
docker:19.03.12-dind
script
:
script
:
-
docker-compose exec php chmod +x bin/phpunit
-
docker-compose -f $COMPOSE_FILE exec php composer install
-
docker-compose exec php ./bin/phpunit
-
docker-compose -f $COMPOSE_FILE exec php vendor/bin/phpunit
dependencies
:
after_script
:
-
build
-
docker-compose -f $COMPOSE_FILE down
# Job de déploiement
deploy
:
stage
:
deploy
script
:
-
echo "Déploiement de l'application..."
# Remplacer par tes propres commandes de déploiement
when
:
manual
# Pour déployer manuellement
# Job pour nettoyer les containers
cleanup
:
stage
:
cleanup
script
:
-
docker-compose -f $COMPOSE_FILE down
when
:
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