Skip to content
Snippets Groups Projects
Commit d34885b5 authored by MENACER Mohamed's avatar MENACER Mohamed
Browse files

Merge branch 'br1' into 'main'

fnl version

See merge request !5
parents bb6ae52d 3c6ff22d
No related branches found
No related tags found
1 merge request!5fnl version
Pipeline #47575 failed
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment