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
Merge requests
!5
fnl version
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
fnl version
br1
into
main
Overview
0
Commits
1
Pipelines
1
Changes
2
Merged
fnl version
MENACER Mohamed
requested to merge
br1
into
main
4 months ago
Overview
0
Commits
1
Pipelines
1
Changes
2
0
0
Merge request reports
Compare
main
version 1
3c6ff22d
4 months ago
main (base)
and
latest version
latest version
3c6ff22d
1 commit,
4 months ago
version 1
3c6ff22d
1 commit,
4 months ago
2 files
+
45
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
.gitlab-ci.yml
0 → 100644
+
45
−
0
View file @ 3c6ff22d
Edit in single-file editor
Open in Web IDE
stages
:
-
build
-
test
-
deploy
variables
:
DOCKER_IMAGE
:
"
registry.gitlab.com/votre-projet/symfony-app"
PHP_IMAGE
:
"
php:8.2-cli"
before_script
:
-
apt-get update && apt-get install -y unzip git curl
# Étape 1 : Build de l'image Docker
build
:
stage
:
build
image
:
docker:latest
services
:
-
docker:dind
script
:
-
docker build -t $DOCKER_IMAGE .
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
docker push $DOCKER_IMAGE
# Étape 2 : Exécution des tests Symfony (PHPUnit)
test
:
stage
:
test
image
:
$PHP_IMAGE
services
:
-
mysql:latest
script
:
-
docker-compose up -d database mailer
-
composer install
-
php bin/phpunit
only
:
-
main
# Exécute les tests uniquement sur la branche principale
# Étape 3 : Déploiement (optionnel)
deploy
:
stage
:
deploy
image
:
alpine:latest
script
:
-
echo "Déploiement en cours..."
-
ssh root@mon-serveur "docker pull $DOCKER_IMAGE && docker-compose up -d"
only
:
-
main
# Déploie seulement si c'est sur la branche main
Loading