From de190da22b451948dc37173b50d235abcf8e7621 Mon Sep 17 00:00:00 2001 From: waelabdallah Date: Fri, 22 Nov 2024 22:02:19 +0100 Subject: [PATCH] update pipeline --- .github/workflows/.DS_Store | Bin 0 -> 6148 bytes .github/workflows/cart-service-ci-cd.yml | 0 .github/workflows/catalog-service-ci-cd.yml | 2 +- .github/workflows/ci-cd.yml | 53 ++++++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/.DS_Store create mode 100644 .github/workflows/cart-service-ci-cd.yml create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/.DS_Store b/.github/workflows/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7a9e9fd303b29c0cf07ee3b3c0e25165d9f8e11b GIT binary patch literal 6148 zcmeHKO-}+b5Pek+s25Jg0bImF+Hu)NORAhq2zH zr$PG^1CF0#%=U<5W}GiyI4xwh8ogqDVqJ5|IZl%6`}8npPLg5H_yHc6SL#}v{3v< NAkyH<8TeKP-T~qWgna-2 literal 0 HcmV?d00001 diff --git a/.github/workflows/cart-service-ci-cd.yml b/.github/workflows/cart-service-ci-cd.yml new file mode 100644 index 00000000..e69de29b diff --git a/.github/workflows/catalog-service-ci-cd.yml b/.github/workflows/catalog-service-ci-cd.yml index f7e9424e..f26d0cf0 100644 --- a/.github/workflows/catalog-service-ci-cd.yml +++ b/.github/workflows/catalog-service-ci-cd.yml @@ -71,7 +71,7 @@ jobs: run: | sshpass -p "${{ secrets.DEPLOYMENT_MACHINE_USER_PSW }}" ssh ${{ secrets.DEPLOYMENT_MACHINE_USER }}@${{ secrets.DEPLOYMENT_MACHINE_IP }} "ls -l ~/service-catalog/service-catalog.jar" - - name: Show system resources usage after file transfer + run: | # Vérifier l'utilisation des ressources sur le serveur après le transfert echo "Utilisation des ressources sur le serveur VPS après transfert :" diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..5f42e44c --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,53 @@ +name: CI/CD Pipeline + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + services: + docker: + image: docker:19.03.12 + options: --privileged + ports: + - 5434:5432 + - 5435:5432 + - 5436:5432 + - 5437:5432 + - 5438:5432 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + + - name: Build with Quarkus + run: | + cd catalog/ + cd catalog-service/ + quarkus build + + - name: Run Quarkus tests + run: | + cd catalog/ + cd catalog-service/ + quarkus test + + - name: Build and run Docker Compose + run: | + docker-compose -f docker-compose.yml up --build -d + + - name: Deploy + run: | + docker-compose -f docker-compose.yml up -d \ No newline at end of file