From 4e69d55df35a0408281b963570bb54b7c36e9f23 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 24 Sep 2024 16:07:59 +0200 Subject: [PATCH] test ftp cicd --- .drone.yml | 24 ++++++++++-------------- _aaaaadrone2.yml | 37 +++++++++++++++++++++++++++++++++++++ _aaaaadrone3.yml | 23 +++++++++++++++++++++++ 3 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 _aaaaadrone2.yml create mode 100644 _aaaaadrone3.yml diff --git a/.drone.yml b/.drone.yml index bc210f2..7a80158 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,25 +1,21 @@ kind: pipeline -name: Déploiement du Theme Test +name: default steps: - - name: Clone Git Submodules - image: alpine/git - commands: - - git submodule init - - git submodule update --recursive --remote - - - name: Deploy to FTP server + - name: master_build image: cschlosser/drone-ftps environment: FTP_USERNAME: from_secret: ftp_username FTP_PASSWORD: from_secret: ftp_password + PLUGIN_HOSTNAME: test.deligraph.com:22 + PLUGIN_SRC_DIR: ./ + PLUGIN_DEST_DIR: /test PLUGIN_SECURE: false PLUGIN_VERIFY: false - PLUGIN_HOSTNAME: test.deligraph.com - PLUGIN_SRC_DIR: /Deligraph-V3 - PLUGIN_DEST_DIR: /test - PLUGIN_AUTO_CONFIRM: true - PLUGIN_DEBUG: true - PLUGIN_ONLY_NEWER: true + when: + branch: + - main + event: + - push diff --git a/_aaaaadrone2.yml b/_aaaaadrone2.yml new file mode 100644 index 0000000..4c9f3c1 --- /dev/null +++ b/_aaaaadrone2.yml @@ -0,0 +1,37 @@ +--- +kind: pipeline +type: ssh +name: Homegrade | Déploiment du Thème + +clone: + disable: true + +server: + host: + from_secret: build_server_host + user: + from_secret: build_server_user + password: + from_secret: build_server_password + +steps: + - name: Clonage du Repo + commands: + - git clone https://git.deligraph.be/Antoine/homegrade_theme_production.git + - name: Installation du package + commands: + - cd homegrade_theme_production + - npm install + - name: Build du package + commands: + - cd homegrade_theme_production + - npm run production + - name: deploy-via-sftp + image: appleboy/drone-scp + settings: + host: sftp.your-server.com + username: your-username + password: your-password # Utiliser une variable d'environnement pour plus de sécurité + port: 22 + target: /test/ + source: ./build/* # Répertoire source avec les fichiers à déployer diff --git a/_aaaaadrone3.yml b/_aaaaadrone3.yml new file mode 100644 index 0000000..5aacabd --- /dev/null +++ b/_aaaaadrone3.yml @@ -0,0 +1,23 @@ +name: Docker Image + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: cschlosser/drone-ftps