From f2fc5e1eff65d1a6717f5106e5b787b58381ddeb Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:28:12 +0100 Subject: [PATCH 01/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index a4377ce..9c5302b 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -12,6 +12,23 @@ pipeline { git url: 'https://github.com/vanessakovalsky/python-api-handle-it.git' } } + stage('Security analysis') { + steps{ + sh "docker run --rm --volume \$(pwd) secfigo/bandit:latest" + } + } + stage ("Dependency Check with Python Safety"){ + steps{ + sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check" + sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check --json > report.json" + } + } + stage ("Static Analysis with python-taint"){ + steps{ + sh "docker run --rm --volume \$(pwd) vickyrajagopal/python-taint-docker pyt ." + } + } + stage('continuous integration') { // Compile and do unit testing tools { gradle 'installGradle' @@ -77,4 +94,4 @@ pipeline { } } } - } \ No newline at end of file + } From 793602537a15d0b29a502348c222a03f7b624112 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:34:36 +0100 Subject: [PATCH 02/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 9c5302b..c311dc8 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -19,8 +19,11 @@ pipeline { } stage ("Dependency Check with Python Safety"){ steps{ - sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check" - sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check --json > report.json" + catchError { + sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check" + sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check --json > report.json" + } + echo currentBuild.result } } stage ("Static Analysis with python-taint"){ From 3fd282ff3d04812376a88c4eda0cf9798dae8ad9 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:46:13 +0100 Subject: [PATCH 03/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index c311dc8..f9662ca 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -40,10 +40,10 @@ pipeline { parallel ( // run Gradle to execute compile and unit testing pylint: { - sh 'gradle lint' + sh 'cd continuous-integration && gradle lint' }, pycode: { - sh 'gradle pycode' + sh 'cd continuous-integration && gradle pycode' } ) } @@ -63,7 +63,7 @@ pipeline { gradle 'installGradle' } steps { - sh 'gradle up' + sh 'cd continuous-integration && gradle up' } } From 898726bd865ad96c8679acda8dc238e73982ac3d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:47:37 +0100 Subject: [PATCH 04/87] Update build.gradle --- continuous-integration/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/continuous-integration/build.gradle b/continuous-integration/build.gradle index 370d7c2..f3eb5e0 100644 --- a/continuous-integration/build.gradle +++ b/continuous-integration/build.gradle @@ -13,7 +13,7 @@ task purge(type:Delete) { task dep(type:Exec, dependsOn: purge) { //println 'Installing dependencies' executable 'sh' - args '-c', 'pip3 install -r app/requirements.txt' + args '-c', 'pip install -r app/requirements.txt' standardOutput = new ByteArrayOutputStream() ext.output = { return standardOutput.toString() } } @@ -62,4 +62,4 @@ task updateItManagement(type:Exec, dependsOn: up) { args '-c', 'curl -v http://localhost:5000/application' standardOutput = new ByteArrayOutputStream() ext.output = { return standardOutput.toString() } -} \ No newline at end of file +} From 75daa9dd111bc8b165382536f0f653ee3b3a06fc Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:50:15 +0100 Subject: [PATCH 05/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index f9662ca..7a3c358 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -5,7 +5,11 @@ pipeline { registryCredential = 'docker' } - agent any + agent { + docker { + image 'python3' + } + } stages { stage('Clone sources') { steps { From fc307f6dea900295c41654e221d7743590db305a Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:51:28 +0100 Subject: [PATCH 06/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 7a3c358..be79c9f 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -7,7 +7,7 @@ pipeline { agent { docker { - image 'python3' + image 'python' } } stages { From d5c5d0de93a536efe72b440f27bfa08d389683ea Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:53:24 +0100 Subject: [PATCH 07/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index be79c9f..377a247 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -17,6 +17,11 @@ pipeline { } } stage('Security analysis') { + agent { + docker { + image 'dind' + } + } steps{ sh "docker run --rm --volume \$(pwd) secfigo/bandit:latest" } From 7f228d168070ed7693aff3748e1b7b3531d9a6e7 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 20 Dec 2023 14:55:19 +0100 Subject: [PATCH 08/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 377a247..080b511 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -17,11 +17,7 @@ pipeline { } } stage('Security analysis') { - agent { - docker { - image 'dind' - } - } + agent any steps{ sh "docker run --rm --volume \$(pwd) secfigo/bandit:latest" } From 3e6faece6a39f023a16d97bcff1f8983d465c9ef Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 3 Jul 2024 09:27:35 +0200 Subject: [PATCH 09/87] Update Dockerfile --- docker-app/python/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-app/python/Dockerfile b/docker-app/python/Dockerfile index bcaf3f8..3d9b635 100644 --- a/docker-app/python/Dockerfile +++ b/docker-app/python/Dockerfile @@ -1,5 +1,5 @@ FROM python:3 - +#Commentaire WORKDIR /app COPY app/ . @@ -8,4 +8,4 @@ RUN pip install --no-cache-dir -r requirements.txt ENV FLASK_APP="main" -CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"] \ No newline at end of file +CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"] From c234494c4f025d67e7f8ba28fdecc72c0099ca63 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 3 Jul 2024 09:30:23 +0200 Subject: [PATCH 10/87] Update Dockerfile --- docker-app/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-app/python/Dockerfile b/docker-app/python/Dockerfile index 3d9b635..90bddd9 100644 --- a/docker-app/python/Dockerfile +++ b/docker-app/python/Dockerfile @@ -2,7 +2,7 @@ FROM python:3 #Commentaire WORKDIR /app -COPY app/ . +COPY ../../app/ . RUN pip install --no-cache-dir -r requirements.txt From 5e7688d6e486a691c10a19e15957df039747e945 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 15:37:17 +0200 Subject: [PATCH 11/87] Update Readme.md --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index e8524b0..64c71ab 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # Application exemple en Python - +Test ## Doc API - Swagger https://app.swaggerhub.com/apis/vanessakovalsky/IT-Management/1.0.0#/ From a02c151461abc03bb56112b0e6079595693f09d0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 15:59:48 +0200 Subject: [PATCH 12/87] Create python-app.yml --- .github/workflows/python-app.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..541a240 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest app/tests/ From 07108f93f334df53d6d0227358f78591454255c2 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:03:03 +0200 Subject: [PATCH 13/87] Update python-app.yml --- .github/workflows/python-app.yml | 38 -------------------------------- 1 file changed, 38 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 541a240..8b13789 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -1,39 +1 @@ -# This workflow will install Python dependencies, run tests and lint with a single version of Python -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest app/tests/ From b9b98178595e9e6b2699a9fa1435625057f45404 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:43:36 +0200 Subject: [PATCH 14/87] Create correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/correction-exercice-1.yml diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml new file mode 100644 index 0000000..6f093a0 --- /dev/null +++ b/.github/workflows/correction-exercice-1.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest unittest + if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + python -m unittest test/unit/test.py From 62cb9651c79fc72cf85f6368e09f279c76881134 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:44:38 +0200 Subject: [PATCH 15/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 6f093a0..35137ee 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest unittest + pip install flake8 pytest html-testRunner if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi - name: Lint with flake8 run: | From f167b53045af0164651b67b7db87911ad1b35dc9 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:47:52 +0200 Subject: [PATCH 16/87] Update application.py --- app/application/application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/application/application.py b/app/application/application.py index 08ad2c6..5df1f76 100644 --- a/app/application/application.py +++ b/app/application/application.py @@ -10,7 +10,7 @@ def add(data): return 'Application ajoutée' def get(nom): - return self + return self.nom def liste(): return 'Liste des applications' From d0cc7c0372e4d06e2e92002623ebf6a486a7e6d0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:49:01 +0200 Subject: [PATCH 17/87] Update application.py --- app/application/application.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/application/application.py b/app/application/application.py index 5df1f76..c4d2643 100644 --- a/app/application/application.py +++ b/app/application/application.py @@ -9,7 +9,7 @@ def __init__(self): def add(data): return 'Application ajoutée' - def get(nom): + def get(self): return self.nom def liste(): From cc3df4c174cdf6a48129396bfb716c57c55f78d0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:50:23 +0200 Subject: [PATCH 18/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 35137ee..37e6f6d 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -36,4 +36,4 @@ jobs: flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - python -m unittest test/unit/test.py + python -m unittest app/test/unit/test.py From 63109416992ecec00f0511a9ac584edf0d844cac Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:51:46 +0200 Subject: [PATCH 19/87] Update test.py --- app/test/unit/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 55daa2c..872aa9e 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -2,8 +2,8 @@ import json import HtmlTestRunner -from application.application import Application -from machine.machine import Machine +from application import Application +from machine import Machine class TestApplication(unittest.TestCase): # Initialisation de données pour mes tests @@ -50,4 +50,4 @@ def test_add_application(self): if __name__ == "__main__": - unittest.main() \ No newline at end of file + unittest.main() From 2ecf1039592c5e5f41eb89bb7a61284b203b725c Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:54:59 +0200 Subject: [PATCH 20/87] Update test.py --- app/test/unit/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 872aa9e..8ed5525 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -2,8 +2,8 @@ import json import HtmlTestRunner -from application import Application -from machine import Machine +import application.application.Application as Application +import machine.machine.Machine as Machine class TestApplication(unittest.TestCase): # Initialisation de données pour mes tests From c4fb379d4f2adbcf4f00c06ab51fe1846af5954e Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 28 Aug 2024 16:59:54 +0200 Subject: [PATCH 21/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 37e6f6d..6da2c12 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application +name: Python application - Correction on: push: @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest html-testRunner + pip install flake8 html-testRunner if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi - name: Lint with flake8 run: | @@ -34,6 +34,6 @@ jobs: flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest + - name: Test with unittest run: | python -m unittest app/test/unit/test.py From 85bdf914a70912172e3bf7f5fc8b1ca45c739c59 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 09:32:06 +0200 Subject: [PATCH 22/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 6da2c12..3e2e4c4 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -36,4 +36,5 @@ jobs: flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with unittest run: | - python -m unittest app/test/unit/test.py + cd app + python -m unittest test/unit/test.py From 49063cbf47257b15b38dae91522551ea272eae36 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 10:39:39 +0200 Subject: [PATCH 23/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 3e2e4c4..e32e7fd 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -34,7 +34,21 @@ jobs: flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with unittest - run: | - cd app - python -m unittest test/unit/test.py + #- name: Test with unittest + # run: | + # cd app + # python -m unittest test/unit/test.py + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + #- name: Build and push + # uses: docker/build-push-action@v4 + # with: + # push: true + # tags: simplecloudquestions/example_docker:latest From f788f2545a16dc92896e3d289111370d166957ea Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 10:58:16 +0200 Subject: [PATCH 24/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index e32e7fd..6047264 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -47,8 +47,9 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - #- name: Build and push - # uses: docker/build-push-action@v4 - # with: - # push: true - # tags: simplecloudquestions/example_docker:latest + - name: Build and push + uses: docker/docker-build-push@v6 + with: + image: vanessakovalsky/python-flask-app-github + tags: v1, latest + dockerfile: docker-app/python/Dockerfile From bcc6d15baa156f5718fbb7d7a81d858375a15425 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 11:01:09 +0200 Subject: [PATCH 25/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index 6047264..aa9df1d 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -48,7 +48,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: docker/docker-build-push@v6 + uses: mr-smithers-excellent/docker-build-push@v6 with: image: vanessakovalsky/python-flask-app-github tags: v1, latest From da3fead79aa9c87a2b173d559ada93af53245533 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 11:04:04 +0200 Subject: [PATCH 26/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index aa9df1d..ac91821 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -48,8 +48,8 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - uses: mr-smithers-excellent/docker-build-push@v6 + uses: docker/build-push-action@v6 with: - image: vanessakovalsky/python-flask-app-github - tags: v1, latest - dockerfile: docker-app/python/Dockerfile + push: true + tags: vanessakovalsky/python-flask-app-github:latest + file: docker-app/python/Dockerfile From 1eb41a06edb4b31e70434b4227c5f29fcae53505 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 11:24:22 +0200 Subject: [PATCH 27/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index ac91821..effb863 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -53,3 +53,4 @@ jobs: push: true tags: vanessakovalsky/python-flask-app-github:latest file: docker-app/python/Dockerfile + context: app From 80c9f5f4c14dd4e1d7189d2586c57b0791feba2c Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 11:25:16 +0200 Subject: [PATCH 28/87] Update Dockerfile --- docker-app/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-app/python/Dockerfile b/docker-app/python/Dockerfile index 90bddd9..f15989d 100644 --- a/docker-app/python/Dockerfile +++ b/docker-app/python/Dockerfile @@ -2,7 +2,7 @@ FROM python:3 #Commentaire WORKDIR /app -COPY ../../app/ . +COPY . . RUN pip install --no-cache-dir -r requirements.txt From 5cac4510189d66b4472f2f46a81bf01fe2ce13e4 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 11:32:41 +0200 Subject: [PATCH 29/87] Update Readme.md --- Readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Readme.md b/Readme.md index 64c71ab..5f5c9ac 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,5 @@ # Application exemple en Python -Test ## Doc API - Swagger https://app.swaggerhub.com/apis/vanessakovalsky/IT-Management/1.0.0#/ From b6bf2043b00288c36aff3d690b81ded42d234d57 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 12:16:12 +0200 Subject: [PATCH 30/87] Create correction-exercice-2.yml --- .github/workflows/correction-exercice-2.yml | 56 +++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/correction-exercice-2.yml diff --git a/.github/workflows/correction-exercice-2.yml b/.github/workflows/correction-exercice-2.yml new file mode 100644 index 0000000..effb863 --- /dev/null +++ b/.github/workflows/correction-exercice-2.yml @@ -0,0 +1,56 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application - Correction + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 html-testRunner + if [ -f app/requirements.txt ]; then pip install -r app/requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + #- name: Test with unittest + # run: | + # cd app + # python -m unittest test/unit/test.py + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: vanessakovalsky/python-flask-app-github:latest + file: docker-app/python/Dockerfile + context: app From 4c4f0a810228c5fda3a988c1dd778c9d96cbcad6 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 12:16:31 +0200 Subject: [PATCH 31/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index effb863..debd38e 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -38,19 +38,3 @@ jobs: # run: | # cd app # python -m unittest test/unit/test.py - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: true - tags: vanessakovalsky/python-flask-app-github:latest - file: docker-app/python/Dockerfile - context: app From 43d0512d5047d3df159af8e632cc80ba8302e141 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 12:17:08 +0200 Subject: [PATCH 32/87] Update correction-exercice-1.yml --- .github/workflows/correction-exercice-1.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/correction-exercice-1.yml b/.github/workflows/correction-exercice-1.yml index debd38e..0a36f75 100644 --- a/.github/workflows/correction-exercice-1.yml +++ b/.github/workflows/correction-exercice-1.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Python application - Correction +name: Python application - Correction exercice 1 on: push: @@ -34,7 +34,7 @@ jobs: flake8 app/ --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 app/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - #- name: Test with unittest - # run: | - # cd app - # python -m unittest test/unit/test.py + - name: Test with unittest + run: | + cd app + python -m unittest test/unit/test.py From d3e6be2ca9fd9c896318c4e6c185bf729340d407 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:38:01 +0200 Subject: [PATCH 33/87] Create correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/correction-exercice-3.yml diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml new file mode 100644 index 0000000..64c61e2 --- /dev/null +++ b/.github/workflows/correction-exercice-3.yml @@ -0,0 +1,30 @@ +name: Python Pull Request Workflow +on: [pull_request] +jobs: + + qa: + name: Quality check + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: Set up Python + uses: actions/setup-python@master + with: + python-version: 3.8 + - name: Run unit tests + run: | + pip install pytest + pytest + - name: Wemake Python Stylguide + uses: wemake-services/wemake-python-styleguide@0.13.4 + continue-on-error: true + with: + reporter: 'github-pr-review' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: unittests From c911427bd925d4db9885ee8fe8556392639feaa9 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:39:15 +0200 Subject: [PATCH 34/87] Update test.py --- app/test/unit/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 8ed5525..5cdf959 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -2,8 +2,8 @@ import json import HtmlTestRunner -import application.application.Application as Application -import machine.machine.Machine as Machine +import application.Application as Application +import machine.Machine as Machine class TestApplication(unittest.TestCase): # Initialisation de données pour mes tests From 9e8249d9c425129271583456ed5bf51e9f7782f9 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:40:18 +0200 Subject: [PATCH 35/87] Update test.py --- app/test/unit/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 5cdf959..615ea89 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -2,8 +2,8 @@ import json import HtmlTestRunner -import application.Application as Application -import machine.Machine as Machine +from machine.machine import Machine +from application.application import Application class TestApplication(unittest.TestCase): # Initialisation de données pour mes tests From f31064dbae02e8f6ec9ac590d0834561b3ce772a Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:44:53 +0200 Subject: [PATCH 36/87] Update correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml index 64c61e2..1205bb9 100644 --- a/.github/workflows/correction-exercice-3.yml +++ b/.github/workflows/correction-exercice-3.yml @@ -13,8 +13,11 @@ jobs: python-version: 3.8 - name: Run unit tests run: | - pip install pytest - pytest + pip install html-testRunner + cd app + python -m unittest test/unit/test.py + python -m coverage run -m unittest test/unit/test.py + python -m coverage xml - name: Wemake Python Stylguide uses: wemake-services/wemake-python-styleguide@0.13.4 continue-on-error: true From 55d50742fa701383f204d75ae15e8cdbb2298ce2 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:57:41 +0200 Subject: [PATCH 37/87] Update correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml index 1205bb9..a088b3c 100644 --- a/.github/workflows/correction-exercice-3.yml +++ b/.github/workflows/correction-exercice-3.yml @@ -1,5 +1,5 @@ name: Python Pull Request Workflow -on: [pull_request] +on: [push] jobs: qa: From 93899b5ce19d1e5a822ef9c66730cae9efd3eea0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:58:08 +0200 Subject: [PATCH 38/87] Delete .github/workflows/docker-image.yml --- .github/workflows/docker-image.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 12e0345..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file docker-app/python/Dockerfile --tag my-image-name:$(date +%s) From 0f8df72eb4aa19e6c1998a4ed31e9b1e7025ced5 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:58:21 +0200 Subject: [PATCH 39/87] Delete .github/workflows/pylint.yml --- .github/workflows/pylint.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml deleted file mode 100644 index 383e65c..0000000 --- a/.github/workflows/pylint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Pylint - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - - name: Analysing the code with pylint - run: | - pylint $(git ls-files '*.py') From 538904a4345be20f0afaf785341a194febf016e9 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 13:58:32 +0200 Subject: [PATCH 40/87] Delete .github/workflows/python-app.yml --- .github/workflows/python-app.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 8b13789..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1 +0,0 @@ - From 2a8984e1fd26f6b9fa1976425443df7be2f0a67e Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 14:02:23 +0200 Subject: [PATCH 41/87] Update correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml index a088b3c..fd1db16 100644 --- a/.github/workflows/correction-exercice-3.yml +++ b/.github/workflows/correction-exercice-3.yml @@ -1,10 +1,10 @@ -name: Python Pull Request Workflow +name: Correction exercice 3 on: [push] jobs: qa: name: Quality check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Set up Python From 2aaed558af9876130cff11bc1cf9b6fdaa58210a Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 14:03:53 +0200 Subject: [PATCH 42/87] Update correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml index fd1db16..6763856 100644 --- a/.github/workflows/correction-exercice-3.yml +++ b/.github/workflows/correction-exercice-3.yml @@ -13,7 +13,7 @@ jobs: python-version: 3.8 - name: Run unit tests run: | - pip install html-testRunner + pip install html-testRunner coverage cd app python -m unittest test/unit/test.py python -m coverage run -m unittest test/unit/test.py From a737eec179665d92003941730e179945fe3ef897 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 16:02:22 +0200 Subject: [PATCH 43/87] Update test.py --- app/test/unit/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 615ea89..47d7295 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -17,9 +17,9 @@ class TestApplication(unittest.TestCase): # Exemple de test avec un echec (failure) - # def test_liste_application_ko(self): - # contenu_liste = Application.liste() - # self.assertEqual(contenu_liste,'Une phrase') + def test_liste_application_ko(self): + contenu_liste = Application.liste() + self.assertEqual(contenu_liste,'Une phrase') def test_liste_application_ok(self): contenu_liste = Application.liste() From a03c451360c3bc9195795a552b2ad9d7e1bd3e5c Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 16:04:23 +0200 Subject: [PATCH 44/87] Update test.py --- app/test/unit/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/unit/test.py b/app/test/unit/test.py index 47d7295..2398737 100644 --- a/app/test/unit/test.py +++ b/app/test/unit/test.py @@ -17,9 +17,9 @@ class TestApplication(unittest.TestCase): # Exemple de test avec un echec (failure) - def test_liste_application_ko(self): - contenu_liste = Application.liste() - self.assertEqual(contenu_liste,'Une phrase') + # def test_liste_application_ko(self): + # contenu_liste = Application.liste() + # self.assertEqual(contenu_liste,'Une phrase') def test_liste_application_ok(self): contenu_liste = Application.liste() From 93f868b7e88a876d9b356f34c8d2f3c80f3fdf38 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 29 Aug 2024 16:37:34 +0200 Subject: [PATCH 45/87] Update correction-exercice-3.yml --- .github/workflows/correction-exercice-3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/correction-exercice-3.yml b/.github/workflows/correction-exercice-3.yml index 6763856..10f204e 100644 --- a/.github/workflows/correction-exercice-3.yml +++ b/.github/workflows/correction-exercice-3.yml @@ -29,5 +29,5 @@ jobs: uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml + file: app/coverage.xml flags: unittests From 14189e142f3aa029d572435f6978b6d9d00433e2 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 27 Nov 2024 16:51:50 +0100 Subject: [PATCH 46/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index ab42b61..ad57a90 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -104,3 +104,4 @@ pipeline { }*/ } } +} From 24b7f1bcc9dda47bc9816114d0767d607ef2ae80 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 27 Nov 2024 16:54:13 +0100 Subject: [PATCH 47/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index ad57a90..4d473f2 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -36,8 +36,7 @@ pipeline { sh "docker run --rm --volume \$(pwd) vickyrajagopal/python-taint-docker pyt ." } } - - stage('continuous integration') { // Compile and do unit testing + stage('continuous integration') { // Compile and do unit testing tools { gradle 'installGradle' From f64f00faf628e1ceb443157f24e4ba97d9505857 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 27 Nov 2024 16:55:02 +0100 Subject: [PATCH 48/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 4d473f2..cd28238 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -52,7 +52,7 @@ pipeline { } ) } - }*/ + } // stage('testcode') { // tools { From 37f395a6b7a14176e0e438e38afded83a99d4920 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 27 Nov 2024 16:55:30 +0100 Subject: [PATCH 49/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index cd28238..ab040a6 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -103,4 +103,3 @@ pipeline { }*/ } } -} From a923ad67504025fb859e9e804a4b38658ec352ff Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 08:00:30 +0100 Subject: [PATCH 50/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index ab040a6..b312414 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -5,11 +5,6 @@ pipeline { registryCredential = 'docker' } - agent { - docker { - image 'python' - } - } stages { stage('Clone sources') { steps { From 0bdf0e5f7635da5f63066cbd97a353cde5884f74 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 08:01:09 +0100 Subject: [PATCH 51/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index b312414..e35bebf 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -5,6 +5,8 @@ pipeline { registryCredential = 'docker' } + agent any + stages { stage('Clone sources') { steps { From 23b99dcd3fd226e32fc1286ea88e4452f5598bc0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 08:05:12 +0100 Subject: [PATCH 52/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index e35bebf..304fae9 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -14,23 +14,22 @@ pipeline { } } stage('Security analysis') { - agent any steps{ - sh "docker run --rm --volume \$(pwd) secfigo/bandit:latest" + sh "docker run --rm --volume \"\$(pwd)\" secfigo/bandit:latest" } } stage ("Dependency Check with Python Safety"){ steps{ catchError { - sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check" - sh "docker run --rm --volume \$(pwd) pyupio/safety:latest safety check --json > report.json" + sh "docker run --rm --volume \"\$(pwd)\" pyupio/safety:latest safety check" + sh "docker run --rm --volume \"\$(pwd)\" pyupio/safety:latest safety check --json > report.json" } echo currentBuild.result } } stage ("Static Analysis with python-taint"){ steps{ - sh "docker run --rm --volume \$(pwd) vickyrajagopal/python-taint-docker pyt ." + sh "docker run --rm --volume \"\$(pwd)\" vickyrajagopal/python-taint-docker pyt ." } } stage('continuous integration') { // Compile and do unit testing From 33c5641d4185d88440d0bc099181bae084ed3549 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 08:10:42 +0100 Subject: [PATCH 53/87] Comment gradle part --- continuous-integration/Jenkinsfile | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 304fae9..5ec013f 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -32,23 +32,23 @@ pipeline { sh "docker run --rm --volume \"\$(pwd)\" vickyrajagopal/python-taint-docker pyt ." } } - stage('continuous integration') { // Compile and do unit testing + // stage('continuous integration') { // Compile and do unit testing - tools { - gradle 'installGradle' - } - steps { - parallel ( - // run Gradle to execute compile and unit testing - pylint: { - sh 'cd continuous-integration && gradle lint' - }, - pycode: { - sh 'cd continuous-integration && gradle pycode' - } - ) - } - } + // tools { + // gradle 'installGradle' + // } + // steps { + // parallel ( + // // run Gradle to execute compile and unit testing + // pylint: { + // sh 'cd continuous-integration && gradle lint' + // }, + // pycode: { + // sh 'cd continuous-integration && gradle pycode' + // } + // ) + // } + // } // stage('testcode') { // tools { From 509d7803556e4f961b3c57710ebb851343283ed0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 10:05:19 +0100 Subject: [PATCH 54/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 5ec013f..1b5706d 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -71,7 +71,7 @@ pipeline { stage('Build docker image') { steps{ script { - dockerImage = docker.build registry + ":$BUILD_NUMBER" + dockerImage = docker.build(registry + ":$BUILD_NUMBER","-f docker-app/python/Dockerfile .") } } } From 768176b0b71eb4be83b7a1b1fc8d8044f21eaf92 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 10:07:36 +0100 Subject: [PATCH 55/87] Update Dockerfile --- docker-app/python/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-app/python/Dockerfile b/docker-app/python/Dockerfile index f15989d..d4c77f0 100644 --- a/docker-app/python/Dockerfile +++ b/docker-app/python/Dockerfile @@ -2,7 +2,7 @@ FROM python:3 #Commentaire WORKDIR /app -COPY . . +COPY ../app/ . RUN pip install --no-cache-dir -r requirements.txt From f0d63eb5e749091998180c1077d410bdf25cb271 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 12:06:06 +0100 Subject: [PATCH 56/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 42 +++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 1b5706d..deb62ae 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -3,6 +3,9 @@ pipeline { environment { registry = "vanessakovalsky/my-image-python" registryCredential = 'docker' + APP_CONTAINER_NAME = "myapppython" + DOCKER_IMAGE = registry + DOCKER_TAG = ${BUILD_NUMBER} } agent any @@ -86,9 +89,46 @@ pipeline { } } + + stage('Arrêt du Conteneur Existant') { + steps { + script { + // Arrêter et supprimer le conteneur existant + sh ''' + docker stop ${APP_CONTAINER_NAME} || true + docker rm ${APP_CONTAINER_NAME} || true + ''' + } + } + } + stage('Test image docker') { steps { - sh 'docker run -d --name my-image-python -p 3002:3002 --rm vanessakovalsky/my-image-python' + sh 'docker run -d --name ${APP_CONTAINER_NAME} -p 3002:3002 --rm vanessakovalsky/my-image-python' + } + } + + stage('Vérification du Déploiement') { + steps { + script { + // Attendre le démarrage du conteneur + sh 'sleep 30' + + // Test de santé basique + sh 'curl http://localhost:3002/ || exit 1' + } + } + } + + stage('Nettoyage') { + steps { + script { + // Supprimer les anciennes images + sh ''' + docker image prune -f + docker images | grep ${DOCKER_IMAGE} | grep -v ${DOCKER_TAG} | awk \'{print $3}\' | xargs -r docker rmi || true + ''' + } } } From 3d9170b1803128ed55b38a9d77d12d00d044c30d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 12:07:40 +0100 Subject: [PATCH 57/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index deb62ae..c288493 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { registry = "vanessakovalsky/my-image-python" registryCredential = 'docker' APP_CONTAINER_NAME = "myapppython" - DOCKER_IMAGE = registry + DOCKER_IMAGE = "vanessakovalsky/my-image-python" DOCKER_TAG = ${BUILD_NUMBER} } From d83c9e063d705c1c7dae04cc916c4e61d9d94a1f Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 12:08:25 +0100 Subject: [PATCH 58/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index c288493..f04acdb 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { registryCredential = 'docker' APP_CONTAINER_NAME = "myapppython" DOCKER_IMAGE = "vanessakovalsky/my-image-python" - DOCKER_TAG = ${BUILD_NUMBER} + DOCKER_TAG = "${env.BUILD_NUMBER}" } agent any From c329008a589551fec7d5dc51d53b761a79788632 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 28 Nov 2024 12:54:01 +0100 Subject: [PATCH 59/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index f04acdb..23b928d 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -104,7 +104,7 @@ pipeline { stage('Test image docker') { steps { - sh 'docker run -d --name ${APP_CONTAINER_NAME} -p 3002:3002 --rm vanessakovalsky/my-image-python' + sh 'docker run -d --name ${APP_CONTAINER_NAME} -p 3002:5000 --rm vanessakovalsky/my-image-python:${DOCKER_TAG}' } } From eebe039bf3781b9e1914aac3688127d5fa076896 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 2 Apr 2025 16:43:51 +0200 Subject: [PATCH 60/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 23b928d..6ef4356 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -74,7 +74,7 @@ pipeline { stage('Build docker image') { steps{ script { - dockerImage = docker.build(registry + ":$BUILD_NUMBER","-f docker-app/python/Dockerfile .") + def dockerImage = docker.build(registry + ":$BUILD_NUMBER","-f docker-app/python/Dockerfile .") } } } From e9317cf98432c95f286dc5f041287db68c614f9d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Wed, 2 Apr 2025 16:53:16 +0200 Subject: [PATCH 61/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 6ef4356..23b928d 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -74,7 +74,7 @@ pipeline { stage('Build docker image') { steps{ script { - def dockerImage = docker.build(registry + ":$BUILD_NUMBER","-f docker-app/python/Dockerfile .") + dockerImage = docker.build(registry + ":$BUILD_NUMBER","-f docker-app/python/Dockerfile .") } } } From 1a61832f61d8e55f05b3bc5749686d36b98c4f72 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:24:53 +0200 Subject: [PATCH 62/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 23b928d..1e34124 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -16,12 +16,12 @@ pipeline { git url: 'https://github.com/vanessakovalsky/python-api-handle-it.git' } } - stage('Security analysis') { + stage('Security analysis') { steps{ sh "docker run --rm --volume \"\$(pwd)\" secfigo/bandit:latest" } } - stage ("Dependency Check with Python Safety"){ + stage ("Dependency Check with Python Safety"){ steps{ catchError { sh "docker run --rm --volume \"\$(pwd)\" pyupio/safety:latest safety check" @@ -30,7 +30,7 @@ pipeline { echo currentBuild.result } } - stage ("Static Analysis with python-taint"){ + stage ("Static Analysis with python-taint"){ steps{ sh "docker run --rm --volume \"\$(pwd)\" vickyrajagopal/python-taint-docker pyt ." } From 01b7fd97b31e77be70a3ccad69184ad4d95f45a2 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:30:09 +0200 Subject: [PATCH 63/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 1e34124..25c2f34 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -18,7 +18,7 @@ pipeline { } stage('Security analysis') { steps{ - sh "docker run --rm --volume \"\$(pwd)\" secfigo/bandit:latest" + sh "docker run --rm --volume \"\$(pwd)\":/src secfigo/bandit:latest" } } stage ("Dependency Check with Python Safety"){ From 51a57f9e9bd3608f8a1778d87cdef5db835df4ed Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:36:03 +0200 Subject: [PATCH 64/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 25c2f34..f93410b 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -18,7 +18,8 @@ pipeline { } stage('Security analysis') { steps{ - sh "docker run --rm --volume \"\$(pwd)\":/src secfigo/bandit:latest" + sh "mkdir report" + sh "docker run --rm --volume \"\$(pwd)\":/src --volume report:/report \ secfigo/bandit:latest" } } stage ("Dependency Check with Python Safety"){ From ccd1cdb4f7a303dfa526a266b139fee92f736852 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:36:23 +0200 Subject: [PATCH 65/87] Create bandit.ignore --- bandit.ignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 bandit.ignore diff --git a/bandit.ignore b/bandit.ignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bandit.ignore @@ -0,0 +1 @@ + From 537012934b9dca24e695b401028669258d67af0f Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:37:00 +0200 Subject: [PATCH 66/87] Update Jenkinsfile --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index f93410b..35cf0c7 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { stage('Security analysis') { steps{ sh "mkdir report" - sh "docker run --rm --volume \"\$(pwd)\":/src --volume report:/report \ secfigo/bandit:latest" + sh "docker run --rm --volume \"\$(pwd)\":/src --volume report:/report secfigo/bandit:latest" } } stage ("Dependency Check with Python Safety"){ From 70ee9e26785cb67e8d727e8c0411ce8c0d23366d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:40:03 +0200 Subject: [PATCH 67/87] Comment security analysus error missing file --- continuous-integration/Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 35cf0c7..e3c1b9e 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -16,12 +16,12 @@ pipeline { git url: 'https://github.com/vanessakovalsky/python-api-handle-it.git' } } - stage('Security analysis') { - steps{ - sh "mkdir report" - sh "docker run --rm --volume \"\$(pwd)\":/src --volume report:/report secfigo/bandit:latest" - } - } + //stage('Security analysis') { + // steps{ + // sh "mkdir report" + // sh "docker run --rm --volume \"\$(pwd)\":/src --volume report:/report secfigo/bandit:latest" + // } + //} stage ("Dependency Check with Python Safety"){ steps{ catchError { From 039b69ec1c5affda467047bdd0ba12b5cde78fb3 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 11:51:47 +0200 Subject: [PATCH 68/87] Uncomment gradle part --- continuous-integration/Jenkinsfile | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index e3c1b9e..4a79306 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -36,32 +36,32 @@ pipeline { sh "docker run --rm --volume \"\$(pwd)\" vickyrajagopal/python-taint-docker pyt ." } } - // stage('continuous integration') { // Compile and do unit testing + stage('continuous integration') { // Compile and do unit testing - // tools { - // gradle 'installGradle' - // } - // steps { - // parallel ( - // // run Gradle to execute compile and unit testing - // pylint: { - // sh 'cd continuous-integration && gradle lint' - // }, - // pycode: { - // sh 'cd continuous-integration && gradle pycode' - // } - // ) - // } - // } + tools { + gradle 'installGradle' + } + steps { + parallel ( + // run Gradle to execute compile and unit testing + pylint: { + sh 'cd continuous-integration && gradle lint' + }, + pycode: { + sh 'cd continuous-integration && gradle pycode' + } + ) + } + } - // stage('testcode') { - // tools { - // gradle 'installGradle' - // } - // steps { - // sh 'gradle test' - // } - // } + stage('testcode') { + tools { + gradle 'installGradle' + } + steps { + sh 'gradle test' + } + } /*stage('Package and deploy') { tools { From bf1d498682adc1c412e8df476fba40213815d090 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 14:41:43 +0200 Subject: [PATCH 69/87] Add parameters example --- continuous-integration/Jenkinsfile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 4a79306..741ca01 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -1,16 +1,27 @@ pipeline { - environment { + parameters{ + string(name: 'environnement', defaultValue: 'dev', decription: 'choisir l\'environnement cible' ) + booleanParam(name: 'ouinon', defaultValue: false, description: '') + } + + environment { registry = "vanessakovalsky/my-image-python" registryCredential = 'docker' - APP_CONTAINER_NAME = "myapppython" - DOCKER_IMAGE = "vanessakovalsky/my-image-python" - DOCKER_TAG = "${env.BUILD_NUMBER}" - } + APP_CONTAINER_NAME = "myapppython" + DOCKER_IMAGE = "vanessakovalsky/my-image-python" + DOCKER_TAG = "${env.BUILD_NUMBER}" + } + + // triggers { + // cron('H */4 * * 1-5') + // pollSCM('H */4 * * 1-5') + // upstream(upstreamProjects: 'Correction exercice 3', thresold: hudson.model.Result.SUCCESS) + // } - agent any + agent any - stages { + stages { stage('Clone sources') { steps { git url: 'https://github.com/vanessakovalsky/python-api-handle-it.git' From d3aea7bd8dd1f2039ea29700824b0999a59db89b Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 3 Apr 2025 14:43:51 +0200 Subject: [PATCH 70/87] Fix typo --- continuous-integration/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous-integration/Jenkinsfile b/continuous-integration/Jenkinsfile index 741ca01..9405e02 100644 --- a/continuous-integration/Jenkinsfile +++ b/continuous-integration/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { parameters{ - string(name: 'environnement', defaultValue: 'dev', decription: 'choisir l\'environnement cible' ) + string(name: 'environnement', defaultValue: 'dev', description: 'choisir l\'environnement cible' ) booleanParam(name: 'ouinon', defaultValue: false, description: '') } From baf6b292a0b8789c52c3891d79f4f7190fa40500 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 13:47:05 +0200 Subject: [PATCH 71/87] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..83ca5e2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,31 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: ubuntu-latest + +steps: +- task: ArchiveFiles@2 + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)/app' + includeRootFolder: true + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + replaceExistingArchive: true +- task: AzureRmWebAppDeployment@5 + inputs: + ConnectionType: 'AzureRM' + azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' + appType: 'webAppLinux' + WebAppName: 'VanessaDemo' + packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip' + DeploymentTypeLinux: 'oneDeploy' + echo Add other tasks to build, test, and deploy your project. + echo See https://aka.ms/yaml + displayName: 'Run a multi-line script' + From 5b8d7740ec84de30aa7a1f66662e5bfab877ea8d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 13:48:18 +0200 Subject: [PATCH 72/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 83ca5e2..6f2c339 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,8 +24,4 @@ steps: appType: 'webAppLinux' WebAppName: 'VanessaDemo' packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip' - DeploymentTypeLinux: 'oneDeploy' - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' - + DeploymentTypeLinux: 'oneDeploy' \ No newline at end of file From a6c652a68b62810e8a10c0e6e430a35f4c848206 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 14:02:37 +0200 Subject: [PATCH 73/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6f2c339..9f5e5a9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,7 +12,7 @@ pool: steps: - task: ArchiveFiles@2 inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)/app' + rootFolderOrFile: '$(Build.BinariesDirectory)/app/' includeRootFolder: true archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' From 98ce0de7b3ce99a035d2f15e2d099abed5e537d8 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 14:28:30 +0200 Subject: [PATCH 74/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9f5e5a9..764f13c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -12,7 +12,7 @@ pool: steps: - task: ArchiveFiles@2 inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)/app/' + rootFolderOrFile: 'app/' includeRootFolder: true archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' From 2da120e018462c9245efb8366e424a565451651b Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 14:31:21 +0200 Subject: [PATCH 75/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 764f13c..1b2a369 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,5 +23,5 @@ steps: azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' appType: 'webAppLinux' WebAppName: 'VanessaDemo' - packageForLinux: '$(System.DefaultWorkingDirectory)/**/*.zip' + packageForLinux: '$(System.DefaultWorkingDirectory)/app.zip' DeploymentTypeLinux: 'oneDeploy' \ No newline at end of file From d7b356768b5c49cced10a57f984c2cfc1b875104 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 14:34:25 +0200 Subject: [PATCH 76/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1b2a369..211dc9c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,5 +23,5 @@ steps: azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' appType: 'webAppLinux' WebAppName: 'VanessaDemo' - packageForLinux: '$(System.DefaultWorkingDirectory)/app.zip' + packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' DeploymentTypeLinux: 'oneDeploy' \ No newline at end of file From 826e1e48db78b1f5644a5671cbad05a8fb317cc4 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 15:13:01 +0200 Subject: [PATCH 77/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 211dc9c..cafdd97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,4 +24,5 @@ steps: appType: 'webAppLinux' WebAppName: 'VanessaDemo' packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + StartupCommand: 'python -m flask --app app/main.py run' DeploymentTypeLinux: 'oneDeploy' \ No newline at end of file From d988100729df2b03d10aa3ab39002d301a1ba5dd Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 15:22:55 +0200 Subject: [PATCH 78/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cafdd97..c58ce59 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,12 +17,13 @@ steps: archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true + - task: AzureRmWebAppDeployment@5 inputs: ConnectionType: 'AzureRM' azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' - appType: 'webAppLinux' - WebAppName: 'VanessaDemo' - packageForLinux: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' - StartupCommand: 'python -m flask --app app/main.py run' - DeploymentTypeLinux: 'oneDeploy' \ No newline at end of file + appType: 'webAppContainer' + WebAppName: 'VanessaApp2' + DockerNamespace: 'vanessakovalsky' + DockerRepository: 'mypythonapp' + DockerImageTag: 'latest' \ No newline at end of file From ea8e834d17d5e5e109b80a42dc024a4b7fd09419 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 15:34:04 +0200 Subject: [PATCH 79/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c58ce59..bf923d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,4 +26,8 @@ steps: WebAppName: 'VanessaApp2' DockerNamespace: 'vanessakovalsky' DockerRepository: 'mypythonapp' - DockerImageTag: 'latest' \ No newline at end of file + DockerImageTag: 'latest' + +- task: CmdLine@2 + inputs: + script: 'wget https://vanessaapp2-awb2d4d4d3dug5cp.canadacentral-01.azurewebsites.net/ | grep ''Bienvenue sur l''application de gestion"' \ No newline at end of file From 7b2314012015fed24cbf377dae92d091f9a8cf57 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 15:56:34 +0200 Subject: [PATCH 80/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 62 ++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf923d2..435301f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,28 +6,44 @@ trigger: - master -pool: - vmImage: ubuntu-latest +jobs: + - job: build + displayName: Build + pool: + vmImage: ubuntu-latest + steps: + - task: ArchiveFiles@2 + inputs: + rootFolderOrFile: 'app/' + includeRootFolder: true + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + replaceExistingArchive: true -steps: -- task: ArchiveFiles@2 - inputs: - rootFolderOrFile: 'app/' - includeRootFolder: true - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' - replaceExistingArchive: true - -- task: AzureRmWebAppDeployment@5 - inputs: - ConnectionType: 'AzureRM' - azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' - appType: 'webAppContainer' - WebAppName: 'VanessaApp2' - DockerNamespace: 'vanessakovalsky' - DockerRepository: 'mypythonapp' - DockerImageTag: 'latest' + - job: waitForValidation + displayName: Wait for external validation + pool: server + timeoutInMinutes: 4320 # job times out in 3 days + steps: + - task: ManualValidation@1 + inputs: + notifyUsers: 'v.david@kovalibre.com' -- task: CmdLine@2 - inputs: - script: 'wget https://vanessaapp2-awb2d4d4d3dug5cp.canadacentral-01.azurewebsites.net/ | grep ''Bienvenue sur l''application de gestion"' \ No newline at end of file + - job: Deployment + displayName: Deployment + pool: + vmImage: ubuntu-latest + steps: + - task: AzureRmWebAppDeployment@5 + inputs: + ConnectionType: 'AzureRM' + azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' + appType: 'webAppContainer' + WebAppName: 'VanessaApp2' + DockerNamespace: 'vanessakovalsky' + DockerRepository: 'mypythonapp' + DockerImageTag: 'latest' + + - task: CmdLine@2 + inputs: + script: 'wget https://vanessaapp2-awb2d4d4d3dug5cp.canadacentral-01.azurewebsites.net/ | grep ''Bienvenue sur l''application de gestion"' \ No newline at end of file From 424adae102cc79968ec314954b1f40df615e5b4d Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 15:59:06 +0200 Subject: [PATCH 81/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 435301f..28ec327 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,7 @@ jobs: - job: Deployment displayName: Deployment + dependsOn: waitForValidation pool: vmImage: ubuntu-latest steps: From cf1a90303986043706380f0563760825f3b056bb Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 16:21:43 +0200 Subject: [PATCH 82/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 28ec327..eb6b6a2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,6 +19,13 @@ jobs: archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true + - task: AzureWebApp@1 + inputs: + azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' + appType: 'webAppLinux' + appName: 'VanessaDemo' + package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + customDeployFolder: ROOT - job: waitForValidation displayName: Wait for external validation @@ -35,6 +42,7 @@ jobs: pool: vmImage: ubuntu-latest steps: + - task: AzureRmWebAppDeployment@5 inputs: ConnectionType: 'AzureRM' From 2f6e3b85fb01bfde1ebf19d0ba153e28abb0831b Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 16:47:20 +0200 Subject: [PATCH 83/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb6b6a2..ef80cf8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,6 +19,13 @@ jobs: archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true + - task: UniversalPackages@0 + inputs: + command: 'publish' + publishDirectory: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' + feedsToUsePublish: 'internal' + vstsFeedPublish: 'bd8e0f81-b92c-4ad5-8333-c9c1800cd9bd/68a8a337-87ce-4623-87a1-a0a9b9b6ad2d' + versionOption: 'patch' - task: AzureWebApp@1 inputs: azureSubscription: 'Paiement à l’utilisation(78b9a3d9-a777-4dad-8f72-5fc24f431d13)' From 2a6c2a61672eaff3662c594f81d43382aabc388b Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 16:50:12 +0200 Subject: [PATCH 84/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ef80cf8..15343be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,6 +25,7 @@ jobs: publishDirectory: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' feedsToUsePublish: 'internal' vstsFeedPublish: 'bd8e0f81-b92c-4ad5-8333-c9c1800cd9bd/68a8a337-87ce-4623-87a1-a0a9b9b6ad2d' + vstsFeedPackagePublish: 'myfirstpythonapp' versionOption: 'patch' - task: AzureWebApp@1 inputs: From 76eaa2c4405801d4549b9e978960aaf7b887ad8e Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 21:49:14 +0200 Subject: [PATCH 85/87] #74 Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 15343be..dad9b5d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,18 +35,18 @@ jobs: package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' customDeployFolder: ROOT - - job: waitForValidation - displayName: Wait for external validation - pool: server - timeoutInMinutes: 4320 # job times out in 3 days - steps: - - task: ManualValidation@1 - inputs: - notifyUsers: 'v.david@kovalibre.com' + # - job: waitForValidation + # displayName: Wait for external validation + # pool: server + # timeoutInMinutes: 4320 # job times out in 3 days + # steps: + # - task: ManualValidation@1 + # inputs: + # notifyUsers: 'v.david@kovalibre.com' - job: Deployment displayName: Deployment - dependsOn: waitForValidation + # dependsOn: waitForValidation pool: vmImage: ubuntu-latest steps: From 9189b3231f36b6e0a04261a3a457d863f8cfc4dc Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 22:30:49 +0200 Subject: [PATCH 86/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dad9b5d..0dd6bb3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,7 +15,7 @@ jobs: - task: ArchiveFiles@2 inputs: rootFolderOrFile: 'app/' - includeRootFolder: true + includeRootFolder: false archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true From 4e2027201c38166ddc6788b1fe901c11c19fbbb0 Mon Sep 17 00:00:00 2001 From: vanessakovalsky Date: Thu, 24 Apr 2025 22:47:41 +0200 Subject: [PATCH 87/87] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0dd6bb3..895117b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,6 +34,7 @@ jobs: appName: 'VanessaDemo' package: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' customDeployFolder: ROOT + startUpCommand: gunicorn --bind=0.0.0.0 main:app # - job: waitForValidation # displayName: Wait for external validation