add docker files
This commit is contained in:
parent
7ad838071d
commit
f7ea271133
@ -1,41 +1,45 @@
|
|||||||
stages:
|
#stages:
|
||||||
- build
|
# - build
|
||||||
- test
|
# - test
|
||||||
- deploy
|
# - deploy
|
||||||
|
#
|
||||||
|
#
|
||||||
build-job:
|
#build-job:
|
||||||
stage: build
|
# stage: build
|
||||||
tags:
|
# tags:
|
||||||
- deploiement
|
# - deploiement
|
||||||
script:
|
# script:
|
||||||
- echo "Compilation du code..."
|
# - echo "Compilation du code..."
|
||||||
# Ajoutez vos commandes de build ici
|
# # Ajoutez vos commandes de build ici
|
||||||
|
#
|
||||||
test-job:
|
#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
|
stage: test
|
||||||
tags:
|
|
||||||
- deploiement
|
|
||||||
script:
|
script:
|
||||||
- echo "Exécution des tests..."
|
- echo "Le runner fonctionne correctement."
|
||||||
# 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
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user