add docker files
This commit is contained in:
parent
b3e978bff1
commit
2d7425bd07
34
.gitlab-ci.yml
Normal file
34
.gitlab-ci.yml
Normal file
@ -0,0 +1,34 @@
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- deploy
|
||||
|
||||
build-job:
|
||||
stage: build
|
||||
script:
|
||||
- echo "Compilation du code..."
|
||||
# Ajoutez vos commandes de build ici
|
||||
|
||||
test-job:
|
||||
stage: test
|
||||
script:
|
||||
- echo "Exécution des tests..."
|
||||
# Ajoutez vos commandes de test ici
|
||||
|
||||
deploy-job:
|
||||
stage: deploy
|
||||
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