From 59996a1c9f56347de3fa66a26ab904cb86d952ad Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 17:50:40 +0100 Subject: [PATCH 01/50] Added editorconfig --- .editorconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c1322dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = false \ No newline at end of file From 3a66ee37bfcb756f1c8e1b2513b96224d3a77e35 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:03:08 +0100 Subject: [PATCH 02/50] Added first workflow with editor config step --- .github/workflows/commit-pipeline.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/commit-pipeline.yaml diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml new file mode 100644 index 0000000..efc38d9 --- /dev/null +++ b/.github/workflows/commit-pipeline.yaml @@ -0,0 +1,14 @@ +name: Commit pipeline +run-name: ${{ github.actor }} made a commit + +on: + push: + ftr/* + +jobs: + editorconfig: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker \ No newline at end of file From 3adc7dac48a5482e3d47060e2d7eaf58e2cab97c Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:05:06 +0100 Subject: [PATCH 03/50] Corrected pipeline syntax --- .github/workflows/commit-pipeline.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index efc38d9..d2e2b87 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -3,7 +3,8 @@ run-name: ${{ github.actor }} made a commit on: push: - ftr/* + branches: + - ftr/* jobs: editorconfig: From 2d8ac817e6e1043620345adcd1c39cc2374fd789 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:10:15 +0100 Subject: [PATCH 04/50] Reformatted --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fdf16c1..9ea6404 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # devops_upskill_2023 Repository with my exercises and projects for the DevOps course I am taking. + \ No newline at end of file From 48ec4a6712f87bd959e3b997b966b19fdebf45eb Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:12:45 +0100 Subject: [PATCH 05/50] Emptied Dockerfile --- Dockerfile | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7182ef3..f996f69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ -FROM ubuntu:22.04 as builder - -RUN apt-get update \ - && apt-get upgrade -y -RUN apt-get install software-properties-common -y \ - && add-apt-repository ppa:deadsnakes/ppa -y \ - && apt-get update +# FROM ubuntu:22.05 as builder -RUN apt-get install python3.10 -y \ - && apt-get install python3-pip -y +# RUN apt-get update \ +# && apt-get upgrade -y +# RUN apt-get install software-properties-common -y \ +# && add-apt-repository ppa:deadsnakes/ppa -y \ +# && apt-get update -FROM builder +# RUN apt-get install python4.10 -y \ +# # && apt-get install python4-pip -y -WORKDIR /app +# FROM builder -COPY requirements.txt /app +# WORKDIR /app -RUN pip install -r requirements.txt +# COPY requirements.txt /app -COPY app /app +# RUN pip install -r requirements.txt -EXPOSE 5000 +# COPY app /app -ENTRYPOINT [ "python3", "app.py" ] \ No newline at end of file +# EXPOSE 5001 + +# ENTRYPOINT [ "python4", "app.py" ] \ No newline at end of file From b4a4dc325f49d8c915e0a16a1ed9051cab1b5fae Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:34:46 +0100 Subject: [PATCH 06/50] Emptied editorconfig for now --- .editorconfig | 12 ------------ .github/workflows/commit-pipeline.yaml | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.editorconfig b/.editorconfig index c1322dc..e69de29 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,12 +0,0 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = false -insert_final_newline = false \ No newline at end of file diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index d2e2b87..50642bb 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -1,15 +1,15 @@ name: Commit pipeline -run-name: ${{ github.actor }} made a commit +run-name: ${{ github.actor }} made a commit on: - push: - branches: - - ftr/* + push: + branches: + - ftr/* -jobs: - editorconfig: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker \ No newline at end of file +jobs: + editorconfig: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker From 672e928ab92a80ab307c29f1e9991cece98d29b3 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:40:52 +0100 Subject: [PATCH 07/50] Added step for checking if editor config exists --- .editorconfig | 8 ++++++++ .github/workflows/commit-pipeline.yaml | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index e69de29..3f168c9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -0,0 +1,8 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 4 \ No newline at end of file diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 50642bb..15b1fc9 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -2,14 +2,16 @@ name: Commit pipeline run-name: ${{ github.actor }} made a commit on: - push: - branches: - - ftr/* + push: + branches: + - ftr/* jobs: - editorconfig: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker + linter-checks: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + + - name: check-editorconfig-existence + if: ${{ hashFiles('.editorconfig') == '' }} + run: echo '.editorconfig exists' From 4bca8f28a8ec0e19121d28fc4920cf230ac27121 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:42:28 +0100 Subject: [PATCH 08/50] Added check if conforming to editorconfig --- .github/workflows/commit-pipeline.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 15b1fc9..161887e 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -15,3 +15,6 @@ jobs: - name: check-editorconfig-existence if: ${{ hashFiles('.editorconfig') == '' }} run: echo '.editorconfig exists' + + - name: check-editorconfig + run: editorconfig-checker From 51fc109079b36d37e86c377cdae151ea46a8df23 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:44:17 +0100 Subject: [PATCH 09/50] Added check if conforming to editorconfig --- .github/workflows/commit-pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 161887e..4af82b0 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -17,4 +17,5 @@ jobs: run: echo '.editorconfig exists' - name: check-editorconfig + uses: editorconfig-checker/action-editorconfig-checker@main run: editorconfig-checker From e0cc9ac072e4572dad6053b9645f0ef4ec34e9b8 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:45:19 +0100 Subject: [PATCH 10/50] Fixed syntax --- .github/workflows/commit-pipeline.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 4af82b0..ffe8bef 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -16,6 +16,5 @@ jobs: if: ${{ hashFiles('.editorconfig') == '' }} run: echo '.editorconfig exists' - - name: check-editorconfig - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker From 0c1f3a0b09ddaf41c34296495a037c3e6dcf1e4b Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:46:46 +0100 Subject: [PATCH 11/50] Emptied editor config --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3f168c9..bcf7006 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,5 +4,5 @@ root = true [*] -indent_style = space -indent_size = 4 \ No newline at end of file +# indent_style = space +# indent_size = 4 \ No newline at end of file From f90bcfccf125d5549be60dc25e548394779390bb Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:55:35 +0100 Subject: [PATCH 12/50] Added Pylint step to pipeline --- .github/workflows/commit-pipeline.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index ffe8bef..da9745a 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -7,14 +7,22 @@ on: - ftr/* jobs: - linter-checks: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 + editorconfig: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 - - name: check-editorconfig-existence - if: ${{ hashFiles('.editorconfig') == '' }} - run: echo '.editorconfig exists' + - name: check-editorconfig-existence + if: ${{ hashFiles('.editorconfig') == '' }} + run: echo '.editorconfig exists' - - uses: editorconfig-checker/action-editorconfig-checker@main + - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker + + pythonlinting: + runs-on: ubuntu22.04 + steps: + - name: Python Pylin GitHub Action + uses: fylein/python-pylint-github-action@v1 + with: + args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc From a416402e79e499ea376f6ef6d69ab25436d18125 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:56:29 +0100 Subject: [PATCH 13/50] Fixed formatting --- .github/workflows/commit-pipeline.yaml | 39 +++++++++++++------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index da9745a..608141a 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -2,27 +2,26 @@ name: Commit pipeline run-name: ${{ github.actor }} made a commit on: - push: - branches: - - ftr/* + push: + branches: + - ftr/* jobs: - editorconfig: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 + editorconfig: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 - - name: check-editorconfig-existence - if: ${{ hashFiles('.editorconfig') == '' }} - run: echo '.editorconfig exists' + - name: check-editorconfig-existence + if: ${{ hashFiles('.editorconfig') == '' }} + run: echo '.editorconfig exists' - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker - - pythonlinting: - runs-on: ubuntu22.04 - steps: - - name: Python Pylin GitHub Action - uses: fylein/python-pylint-github-action@v1 - with: - args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker + + pythonlinting: + runs-on: ubuntu22.04 + steps: + - uses: fylein/python-pylint-github-action@v1 + with: + args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc From 2124f22b45f9695573500c44fca275d14f0cb44c Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 18:58:59 +0100 Subject: [PATCH 14/50] Changed to older version of Ubuntu to see if runs will be faster --- .github/workflows/commit-pipeline.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 608141a..3153066 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -8,7 +8,7 @@ on: jobs: editorconfig: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 @@ -19,9 +19,14 @@ jobs: - uses: editorconfig-checker/action-editorconfig-checker@main - run: editorconfig-checker - pythonlinting: - runs-on: ubuntu22.04 + pylint: + runs-on: ubuntu20.04 steps: - uses: fylein/python-pylint-github-action@v1 with: args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc + + black: + runs-on: ubuntu22.04 + steps: + - uses: psf/black@stable From b2196a6d58cf28e4690b066bc75df3b43adf8cdf Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:02:27 +0100 Subject: [PATCH 15/50] Put correct version of ubuntu --- .github/workflows/commit-pipeline.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 3153066..48c80b8 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -8,7 +8,7 @@ on: jobs: editorconfig: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -20,13 +20,13 @@ jobs: - run: editorconfig-checker pylint: - runs-on: ubuntu20.04 + runs-on: ubuntu-latest steps: - uses: fylein/python-pylint-github-action@v1 with: args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc black: - runs-on: ubuntu22.04 + runs-on: ubuntu-latest steps: - uses: psf/black@stable From 3048bcec5996eddcf10e7f7b108c240ebe2a94ff Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:04:41 +0100 Subject: [PATCH 16/50] Reformatted for Pylint --- README.md | 4 ++-- app/app.py | 2 +- app/app_test.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9ea6404..9325139 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # devops_upskill_2023 -Repository with my exercises and projects for the DevOps course I am taking. - \ No newline at end of file + +Repository with my exercises and projects for the DevOps course I am taking. diff --git a/app/app.py b/app/app.py index 2f12a48..2129eb1 100644 --- a/app/app.py +++ b/app/app.py @@ -11,4 +11,4 @@ def hello_world(): if __name__ == "__main__": - app.run(host="0.0.0.0") \ No newline at end of file + app.run(host="0.0.0.0") diff --git a/app/app_test.py b/app/app_test.py index 526b044..a1b1bac 100644 --- a/app/app_test.py +++ b/app/app_test.py @@ -15,4 +15,3 @@ def test_hello_world(self): if __name__ == "__main__": unittest.main() - \ No newline at end of file From c3435231c8b6c0ec41663a6b91dd443b754781fa Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:06:45 +0100 Subject: [PATCH 17/50] Changed pylint running --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 48c80b8..9c0b0d3 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: pip3 install -r requirements.txt && pylint --rcfile=.pylintrc + args: pip3 install -r requirements.txt; pylint **/*.py black: runs-on: ubuntu-latest From e638719ceb5498d0104e361a5501e10a05196f30 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:07:47 +0100 Subject: [PATCH 18/50] Added quotation marks --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 9c0b0d3..d359966 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: pip3 install -r requirements.txt; pylint **/*.py + args: "pip3 install -r requirements.txt; pylint **/*.py" black: runs-on: ubuntu-latest From 498a9a598f0ff8f958fa9c73487cc5fbb69d34ac Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:09:55 +0100 Subject: [PATCH 19/50] Checking all py files --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index d359966..ed58abc 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: "pip3 install -r requirements.txt; pylint **/*.py" + args: "pip3 install -r requirements.txt; pylint $(find . -name '*.py' | xargs)" black: runs-on: ubuntu-latest From 7814871fa998f0fde3c537ca640e275e4fff3658 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:11:18 +0100 Subject: [PATCH 20/50] Checking all py files --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index ed58abc..857e606 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: "pip3 install -r requirements.txt; pylint $(find . -name '*.py' | xargs)" + args: "pip3 install -r requirements.txt; pylint `ls -R|grep .py$|xargs`" black: runs-on: ubuntu-latest From 7f27ccc5843416ff92c2841f1c431613adf2a1ab Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:12:59 +0100 Subject: [PATCH 21/50] Checking only the app folder --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 857e606..d682f64 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: "pip3 install -r requirements.txt; pylint `ls -R|grep .py$|xargs`" + args: "pip3 install -r requirements.txt; pylint ./app" black: runs-on: ubuntu-latest From 73ca899ae985c5676c15c889b12ec94b768dee27 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:14:22 +0100 Subject: [PATCH 22/50] Added init file --- app/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 app/__init__.py diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..e69de29 From 76409efcea06fefd6e54f94f77a49acde3a55348 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:15:26 +0100 Subject: [PATCH 23/50] Added reqs to app folder --- app/requirements.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 app/requirements.txt diff --git a/app/requirements.txt b/app/requirements.txt new file mode 100644 index 0000000..8c915bb --- /dev/null +++ b/app/requirements.txt @@ -0,0 +1,8 @@ +blinker==1.6.3 ; python_version >= "3.10" and python_version < "4.0" +click==8.1.7 ; python_version >= "3.10" and python_version < "4.0" +colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and platform_system == "Windows" +flask==3.0.0 ; python_version >= "3.10" and python_version < "4.0" +itsdangerous==2.1.2 ; python_version >= "3.10" and python_version < "4.0" +jinja2==3.1.2 ; python_version >= "3.10" and python_version < "4.0" +markupsafe==2.1.3 ; python_version >= "3.10" and python_version < "4.0" +werkzeug==3.0.0 ; python_version >= "3.10" and python_version < "4.0" \ No newline at end of file From 16905ebad4ca6a194baaee4bf461083220e23312 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:17:12 +0100 Subject: [PATCH 24/50] Changed path for pylint --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index d682f64..2cfbd84 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: "pip3 install -r requirements.txt; pylint ./app" + args: "pip3 install -r requirements.txt; pylint app" black: runs-on: ubuntu-latest From a120cff3a8ea454752d31d24d3ee7775096c11ed Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:18:39 +0100 Subject: [PATCH 25/50] Changed path for pylint --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 2cfbd84..ed58abc 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: fylein/python-pylint-github-action@v1 with: - args: "pip3 install -r requirements.txt; pylint app" + args: "pip3 install -r requirements.txt; pylint $(find . -name '*.py' | xargs)" black: runs-on: ubuntu-latest From a0d608624f95d0a682bb3f1e9b569b04a3485c81 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:19:47 +0100 Subject: [PATCH 26/50] Changed action for pylint --- .github/workflows/commit-pipeline.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index ed58abc..cff976c 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -22,9 +22,7 @@ jobs: pylint: runs-on: ubuntu-latest steps: - - uses: fylein/python-pylint-github-action@v1 - with: - args: "pip3 install -r requirements.txt; pylint $(find . -name '*.py' | xargs)" + - uses: cclauss/GitHub-Action-for-pylint@0.7.0 black: runs-on: ubuntu-latest From b3619426b9efac227e75f37fbf6d4b6a40ae988f Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:23:58 +0100 Subject: [PATCH 27/50] Added markdown check --- .github/workflows/commit-pipeline.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index cff976c..43d6291 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -10,7 +10,7 @@ jobs: editorconfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@ - name: check-editorconfig-existence if: ${{ hashFiles('.editorconfig') == '' }} @@ -28,3 +28,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: psf/black@stable +v4 + markdown-check: + runs-on: ubuntu-latest + steps: + - uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: . From b42ae50e46a4e1cbe85f2518297b800340d3e02d Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:24:39 +0100 Subject: [PATCH 28/50] Fixed typo --- .github/workflows/commit-pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 43d6291..e45f91c 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -10,7 +10,7 @@ jobs: editorconfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ + - uses: actions/checkout@v4 - name: check-editorconfig-existence if: ${{ hashFiles('.editorconfig') == '' }} @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: psf/black@stable -v4 + markdown-check: runs-on: ubuntu-latest steps: From bb4283fc61d73e5e25f627acb36f470d21e13e57 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:31:20 +0100 Subject: [PATCH 29/50] Running unit test --- .github/workflows/commit-pipeline.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index e45f91c..21a8030 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -35,3 +35,18 @@ jobs: - uses: nosborn/github-action-markdown-cli@v3.3.0 with: files: . + + unit-test: + runs-on: ubuntu-latest + working-directory: ./app + env: + PYTHON_VERSION: 3.10 + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: $PYTHON_VERSION + - run: pip install -r requirements.txt + - run: cd app + - run: python -m unittest From 80b45ed7af9acbf951dc9d5e01999821558b6070 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:33:45 +0100 Subject: [PATCH 30/50] Running unit test --- .github/workflows/commit-pipeline.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 21a8030..16781dd 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -38,7 +38,7 @@ jobs: unit-test: runs-on: ubuntu-latest - working-directory: ./app + # working-directory: ./app env: PYTHON_VERSION: 3.10 @@ -48,5 +48,6 @@ jobs: with: python-version: $PYTHON_VERSION - run: pip install -r requirements.txt - - run: cd app + working-directory: ./app - run: python -m unittest + working-directory: ./app From bd20e0f8223ceaccb872f166534dab8b6275baa2 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:34:57 +0100 Subject: [PATCH 31/50] Changed python version --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 16781dd..9c0bfd2 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest # working-directory: ./app env: - PYTHON_VERSION: 3.10 + PYTHON_VERSION: 3.13 steps: - uses: actions/checkout@v4 From ef41a929b6dc21672b9a9b60dbddb976b9c8288c Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:35:57 +0100 Subject: [PATCH 32/50] Changed python version --- .github/workflows/commit-pipeline.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 9c0bfd2..0f035c9 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -38,15 +38,11 @@ jobs: unit-test: runs-on: ubuntu-latest - # working-directory: ./app - env: - PYTHON_VERSION: 3.13 - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: $PYTHON_VERSION + python-version: 3.13 - run: pip install -r requirements.txt working-directory: ./app - run: python -m unittest From 63cb761dd7080696759db1c09fa50d25c4ad5b4a Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:38:50 +0100 Subject: [PATCH 33/50] Changed python version --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 0f035c9..6de230c 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: 3.13 + python-version: 3.10 - run: pip install -r requirements.txt working-directory: ./app - run: python -m unittest From 23d4d8dd6ce134d342ca08e08cfea3b253394968 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:39:41 +0100 Subject: [PATCH 34/50] Changed python version --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 6de230c..0c422d5 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: 3.10 + python-version: "3.10" - run: pip install -r requirements.txt working-directory: ./app - run: python -m unittest From 1eb62122b0e4f60562d87dda8e111cb9ec138c1b Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:46:45 +0100 Subject: [PATCH 35/50] Added gitleaks step --- .github/workflows/commit-pipeline.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 0c422d5..26e415f 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -47,3 +47,14 @@ jobs: working-directory: ./app - run: python -m unittest working-directory: ./app + + gitleaks: + - runs-on: ubuntu-latest + needs: unit-test + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 76ed58317cf462c1f514ab6070bf8714ca0285fb Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:47:42 +0100 Subject: [PATCH 36/50] Fixed indentation: --- .github/workflows/commit-pipeline.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 26e415f..1ec18b7 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -49,12 +49,12 @@ jobs: working-directory: ./app gitleaks: - - runs-on: ubuntu-latest - needs: unit-test - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: ubuntu-latest + needs: unit-test + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 26ba93f1d11fcabdbbba651bdaba6ba7da455695 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 19:59:24 +0100 Subject: [PATCH 37/50] Added SonarCloud step --- .github/workflows/commit-pipeline.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 1ec18b7..1d05d0f 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -58,3 +58,11 @@ jobs: - uses: gitleaks/gitleaks-action@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + sonar_cloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: AppThreat/sast-scan-action@master + with: + type: "python" From 6e41a2ac5fb8388e2537c8d287d6268bae7cf7f4 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 20:04:41 +0100 Subject: [PATCH 38/50] Added Snyk check --- .github/workflows/commit-pipeline.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 1d05d0f..bf2dea9 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -8,6 +8,7 @@ on: jobs: editorconfig: + name: "Check for .editorconfig" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -20,16 +21,19 @@ jobs: - run: editorconfig-checker pylint: + name: "Check with Pylint" runs-on: ubuntu-latest steps: - uses: cclauss/GitHub-Action-for-pylint@0.7.0 black: + name: "Check formatting with Black" runs-on: ubuntu-latest steps: - uses: psf/black@stable markdown-check: + name: "Check markdown" runs-on: ubuntu-latest steps: - uses: nosborn/github-action-markdown-cli@v3.3.0 @@ -37,6 +41,7 @@ jobs: files: . unit-test: + name: "Run unit test" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -49,6 +54,7 @@ jobs: working-directory: ./app gitleaks: + name: "Check for leaks in secrets with gitleaks" runs-on: ubuntu-latest needs: unit-test steps: @@ -60,9 +66,20 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sonar_cloud: - name: SonarCloud + name: "Run SonarCloud" runs-on: ubuntu-latest steps: - uses: AppThreat/sast-scan-action@master with: type: "python" + + vulnerability: + name: "Check for vulnerabilities with Snyk" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: snyk/actions/python-3.10@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --severity-threshold=high From 881b53d4ea5b0f6bbe27921bf90b21fc70b5c184 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 20:05:32 +0100 Subject: [PATCH 39/50] Added dependencies: --- .github/workflows/commit-pipeline.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index bf2dea9..fe212ff 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -68,6 +68,7 @@ jobs: sonar_cloud: name: "Run SonarCloud" runs-on: ubuntu-latest + needs: gitleaks steps: - uses: AppThreat/sast-scan-action@master with: @@ -76,6 +77,7 @@ jobs: vulnerability: name: "Check for vulnerabilities with Snyk" runs-on: ubuntu-latest + needs: sonar_cloud steps: - uses: actions/checkout@v4 - uses: snyk/actions/python-3.10@master From ec34dc3aa06940ddb46383125f68aa36d277548b Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Mon, 13 Nov 2023 20:09:47 +0100 Subject: [PATCH 40/50] fixing sonar cloud --- .github/workflows/commit-pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index fe212ff..5633ae3 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -70,6 +70,7 @@ jobs: runs-on: ubuntu-latest needs: gitleaks steps: + - uses: actions/checkout@v4 - uses: AppThreat/sast-scan-action@master with: type: "python" From 379f40d121e90a0c1b07f4fd9b2cd85f4a7a649a Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 17:50:22 +0100 Subject: [PATCH 41/50] Updated workflow with more dependencies between jobs --- .github/workflows/commit-pipeline.yaml | 77 ++++++++++++++------------ 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 5633ae3..cf284f9 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -4,85 +4,90 @@ run-name: ${{ github.actor }} made a commit on: push: branches: - - ftr/* + - ftr/* jobs: editorconfig: name: "Check for .editorconfig" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: check-editorconfig-existence - if: ${{ hashFiles('.editorconfig') == '' }} - run: echo '.editorconfig exists' + - name: check-editorconfig-existence + if: ${{ hashFiles('.editorconfig') == '' }} + run: echo '.editorconfig exists' - - uses: editorconfig-checker/action-editorconfig-checker@main - - run: editorconfig-checker + - uses: editorconfig-checker/action-editorconfig-checker@main + - run: editorconfig-checker pylint: name: "Check with Pylint" runs-on: ubuntu-latest steps: - - uses: cclauss/GitHub-Action-for-pylint@0.7.0 + - uses: cclauss/GitHub-Action-for-pylint@0.7.0 black: name: "Check formatting with Black" runs-on: ubuntu-latest steps: - - uses: psf/black@stable + - uses: psf/black@stable markdown-check: name: "Check markdown" runs-on: ubuntu-latest steps: - - uses: nosborn/github-action-markdown-cli@v3.3.0 - with: - files: . + - uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: . unit-test: name: "Run unit test" runs-on: ubuntu-latest + needs: + - editorconfig + - pylint + - black + - markdown-check steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - run: pip install -r requirements.txt - working-directory: ./app - - run: python -m unittest - working-directory: ./app + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - run: pip install -r requirements.txt + working-directory: ./app + - run: python -m unittest + working-directory: ./app gitleaks: name: "Check for leaks in secrets with gitleaks" runs-on: ubuntu-latest needs: unit-test steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: gitleaks/gitleaks-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sonar_cloud: name: "Run SonarCloud" runs-on: ubuntu-latest needs: gitleaks steps: - - uses: actions/checkout@v4 - - uses: AppThreat/sast-scan-action@master - with: - type: "python" + - uses: actions/checkout@v4 + - uses: AppThreat/sast-scan-action@master + with: + type: "python" vulnerability: name: "Check for vulnerabilities with Snyk" runs-on: ubuntu-latest needs: sonar_cloud steps: - - uses: actions/checkout@v4 - - uses: snyk/actions/python-3.10@master - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - with: - args: --severity-threshold=high + - uses: actions/checkout@v4 + - uses: snyk/actions/python-3.10@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + args: --severity-threshold=high From 319afb144989b6b0d76cc175a29c29005aef3196 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:19:33 +0100 Subject: [PATCH 42/50] Added step in the pipeline to build and push Docker image --- .github/workflows/commit-pipeline.yaml | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index cf284f9..66cec4d 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -91,3 +91,37 @@ jobs: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: args: --severity-threshold=high + + docker-build-push: + name: "Build Docker image, check for vulneratibilities and push" + runs-on: ubuntu_latest + needs: vulnerability + steps: + - name: "Checkout" + uses: actions/checkout@v4 + - name: "Set up QEMU" + uses: docker/setup-qemu-action@v3 + - name: "Set up BuildX" + uses: docker/setup-buildx-action@v3 + - name: "Login to Docker Hub" + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOCKEN}} + - name: "Build and export to Docker (without push)" + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ github.sha }} + # - name: "Scan image" + # uses: aquasecurity/trivy-action@master + # with: + # image-ref: + # format: 'table' + # exit-code: '1' + # ignore-unfixed: true + # vuln-type: 'os,library' + # severity: 'CRITICAL,HIGH' + + From e98325423d8ffdbc1c3621933d91f9ca5f180b26 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:24:59 +0100 Subject: [PATCH 43/50] Fixed typo in runner name; Testing docker build and push --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 66cec4d..9400341 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -94,7 +94,7 @@ jobs: docker-build-push: name: "Build Docker image, check for vulneratibilities and push" - runs-on: ubuntu_latest + runs-on: ubuntu-latest needs: vulnerability steps: - name: "Checkout" From 1a1213235de6ede72a21c2e5e3982ea2d17a6572 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:34:11 +0100 Subject: [PATCH 44/50] Fixed typo in secret name --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index 9400341..ec46b98 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -107,7 +107,7 @@ jobs: uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOCKEN}} + password: ${{ secrets.DOCKERHUB_TOKEN}} - name: "Build and export to Docker (without push)" uses: docker/build-push-action@v3 with: From e109022ef96653b7c1b422f216596243e17a93d2 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:38:03 +0100 Subject: [PATCH 45/50] Uncommented Dockerfile --- Dockerfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index f996f69..658282a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,24 @@ -# FROM ubuntu:22.05 as builder +FROM ubuntu:22.05 as builder -# RUN apt-get update \ -# && apt-get upgrade -y -# RUN apt-get install software-properties-common -y \ -# && add-apt-repository ppa:deadsnakes/ppa -y \ -# && apt-get update +RUN apt-get update \ + && apt-get upgrade -y +RUN apt-get install software-properties-common -y \ + && add-apt-repository ppa:deadsnakes/ppa -y \ + && apt-get update -# RUN apt-get install python4.10 -y \ -# # && apt-get install python4-pip -y +RUN apt-get install python4.10 -y \ + && apt-get install python4-pip -y -# FROM builder +FROM builder -# WORKDIR /app +WORKDIR /app -# COPY requirements.txt /app +COPY requirements.txt /app -# RUN pip install -r requirements.txt +RUN pip install -r requirements.txt -# COPY app /app +COPY app /app -# EXPOSE 5001 +EXPOSE 5001 -# ENTRYPOINT [ "python4", "app.py" ] \ No newline at end of file +ENTRYPOINT [ "python4", "app.py" ] \ No newline at end of file From 062ba187d84a81e3089109b5dbc66186f9d8fb90 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:41:47 +0100 Subject: [PATCH 46/50] Put in correct verion of ubuntu --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 658282a..8141acf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.05 as builder +FROM ubuntu:22.04 as builder RUN apt-get update \ && apt-get upgrade -y From 5ec7322d3db76212c9714bd00c113a0e43ce5be1 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:46:08 +0100 Subject: [PATCH 47/50] Put in correct number values everywhere --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8141acf..f283cdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get install software-properties-common -y \ && add-apt-repository ppa:deadsnakes/ppa -y \ && apt-get update -RUN apt-get install python4.10 -y \ +RUN apt-get install python3.10 -y \ && apt-get install python4-pip -y FROM builder @@ -19,6 +19,6 @@ RUN pip install -r requirements.txt COPY app /app -EXPOSE 5001 +EXPOSE 5000 -ENTRYPOINT [ "python4", "app.py" ] \ No newline at end of file +ENTRYPOINT [ "python3", "app.py" ] \ No newline at end of file From bad7845fddbc8f0862d03fa29bcfbdc1d905e198 Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 18:50:54 +0100 Subject: [PATCH 48/50] Fixed more wrong versions --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f283cdb..20e7401 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,13 @@ FROM ubuntu:22.04 as builder RUN apt-get update \ && apt-get upgrade -y + RUN apt-get install software-properties-common -y \ && add-apt-repository ppa:deadsnakes/ppa -y \ && apt-get update RUN apt-get install python3.10 -y \ - && apt-get install python4-pip -y + && apt-get install python3-pip -y FROM builder From c2f72b746b8fe6f3dd183a678d5b109860651cfb Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 19:04:18 +0100 Subject: [PATCH 49/50] Added prefix to tags in docker/build-push-action --- .github/workflows/commit-pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index ec46b98..a890d39 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -113,7 +113,7 @@ jobs: with: context: . push: true - tags: ${{ github.sha }} + tags: evelonche/app:${{ github.sha }} # - name: "Scan image" # uses: aquasecurity/trivy-action@master # with: From 2d8d1f9d1065d39ecf21f01e14d26bf9b403b28d Mon Sep 17 00:00:00 2001 From: Evelina Masliankova Date: Wed, 15 Nov 2023 19:09:55 +0100 Subject: [PATCH 50/50] Added Trivy step --- .github/workflows/commit-pipeline.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/commit-pipeline.yaml b/.github/workflows/commit-pipeline.yaml index a890d39..37a4e2d 100644 --- a/.github/workflows/commit-pipeline.yaml +++ b/.github/workflows/commit-pipeline.yaml @@ -112,16 +112,16 @@ jobs: uses: docker/build-push-action@v3 with: context: . - push: true + load: true tags: evelonche/app:${{ github.sha }} - # - name: "Scan image" - # uses: aquasecurity/trivy-action@master - # with: - # image-ref: - # format: 'table' - # exit-code: '1' - # ignore-unfixed: true - # vuln-type: 'os,library' - # severity: 'CRITICAL,HIGH' + - name: "Scan image" + uses: aquasecurity/trivy-action@master + with: + image-ref: + format: 'table' + exit-code: '1' + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH'