diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4676f8f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,73 +0,0 @@ -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: - - | - set -e - echo "Déploiement sur Portainer..." - echo "Authentification avec l'API de Portainer..." - - # Vérification des variables d'environnement pour les informations d'authentification - if [ -z "$PORTAINER_USERNAME" ]; then echo "Erreur : PORTAINER_USERNAME non défini."; exit 1; fi - if [ -z "$PORTAINER_PASSWORD" ]; then echo "Erreur : PORTAINER_PASSWORD non défini."; exit 1; fi - if [ -z "$PORTAINER_URL" ]; then echo "Erreur : PORTAINER_URL non défini."; exit 1; fi - if [ -z "$STACK_ID" ]; then echo "Erreur : STACK_ID non défini."; exit 1; fi - if [ -z "$ENDPOINT_ID" ]; then echo "Erreur : ENDPOINT_ID non défini."; exit 1; fi - - # Authentification pour obtenir un JWT - AUTH_RESPONSE=$(curl -s -k -X POST \ - -H "Content-Type: application/json" \ - -d "{\"Username\": \"$PORTAINER_USERNAME\", \"Password\": \"$PORTAINER_PASSWORD\"}" \ - "https://$PORTAINER_URL/api/auth") - - # Extraire le token JWT de la réponse - JWT_TOKEN=$(echo $AUTH_RESPONSE | jq -r .jwt) - - if [ "$JWT_TOKEN" == "null" ]; then - echo "Erreur : Échec de l'authentification avec Portainer." - exit 1 - fi - - echo "Authentification réussie. Token JWT récupéré." - - echo "Déclenchement du redeploiement de la stack Git sur Portainer..." - - # Exécuter la requête pour redeployer la stack Git avec le JWT récupéré - RESPONSE=$(curl -s -k -w "%{http_code}" -X PUT \ - -H "Authorization: Bearer $JWT_TOKEN" \ - -H "Content-Type: application/json" \ - "https://$PORTAINER_URL/api/stacks/$STACK_ID/git/redeploy") - - # Extraire le code HTTP de la réponse - HTTP_CODE="${RESPONSE: -3}" - BODY="${RESPONSE::-3}" - - if [ "$HTTP_CODE" != "200" ]; then - echo "Erreur : Échec du déploiement. Code HTTP : $HTTP_CODE" - echo "Réponse de l'API : $BODY" - exit 1 - fi - - echo "Déploiement terminé avec succès." diff --git a/Dockerfile b/Dockerfile index 596a278..5063525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,8 @@ # Utiliser une image de base légère FROM nginx:alpine -# Copier la page HTML dans le répertoire approprié de Nginx -COPY index.html /usr/share/nginx/html/ -COPY styles.css /usr/share/nginx/html/ -COPY app-ads.txt /usr/share/nginx/html/ +# Copier tout le contenu du dossier src dans le répertoire approprié de Nginx +COPY ./src/ /usr/share/nginx/html/ # Exposer le port 80 EXPOSE 80 diff --git a/index.html b/src/index.html similarity index 89% rename from index.html rename to src/index.html index 5691ac3..5d1ff90 100644 --- a/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - + Canguidev