From f7ea2711334e5deb83f7f6d6c50187bb183e52ce Mon Sep 17 00:00:00 2001 From: canguilieme julien Date: Mon, 7 Oct 2024 21:17:42 +0200 Subject: [PATCH] add docker files --- .gitlab-ci.yml | 82 ++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77130de..b37e449 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,41 +1,45 @@ -stages: - - build - - test - - deploy - - -build-job: - stage: build - tags: - - deploiement - script: - - echo "Compilation du code..." - # Ajoutez vos commandes de build ici - -test-job: +#stages: +# - build +# - test +# - deploy +# +# +#build-job: +# stage: build +# tags: +# - deploiement +# script: +# - echo "Compilation du code..." +# # Ajoutez vos commandes de build ici +# +#test-job: +# stage: test +# tags: +# - deploiement +# script: +# - echo "Exécution des tests..." +# # Ajoutez vos commandes de test ici +# +#deploy-job: +# stage: deploy +# tags: +# - deploiement +# script: +# - echo "Déploiement sur Portainer..." +# - | +# TOKEN=$(curl -s -X POST -d "{\"Username\":\"$PORTAINER_USERNAME\",\"Password\":\"$PORTAINER_PASSWORD\"}" \ +# -H "Content-Type: application/json" http://$PORTAINER_URL/api/auth | jq -r .jwt) +# - | +# curl -s -X PUT \ +# -H "Authorization: Bearer $TOKEN" \ +# -H "Content-Type: application/json" \ +# -d '{"Prune": true}' \ +# http://$PORTAINER_URL/api/stacks/$STACK_ID/deploy +# - echo "Déploiement terminé." +# dependencies: +# - build-job +# - test-job +test-runner: stage: test - tags: - - deploiement script: - - echo "Exécution des tests..." - # Ajoutez vos commandes de test ici - -deploy-job: - stage: deploy - tags: - - deploiement - script: - - echo "Déploiement sur Portainer..." - - | - TOKEN=$(curl -s -X POST -d "{\"Username\":\"$PORTAINER_USERNAME\",\"Password\":\"$PORTAINER_PASSWORD\"}" \ - -H "Content-Type: application/json" http://$PORTAINER_URL/api/auth | jq -r .jwt) - - | - curl -s -X PUT \ - -H "Authorization: Bearer $TOKEN" \ - -H "Content-Type: application/json" \ - -d '{"Prune": true}' \ - http://$PORTAINER_URL/api/stacks/$STACK_ID/deploy - - echo "Déploiement terminé." - dependencies: - - build-job - - test-job + - echo "Le runner fonctionne correctement."