From 7831845d446e1f30b176bdf911c901b7fbd7ded0 Mon Sep 17 00:00:00 2001 From: Joel Hanson Date: Wed, 6 Sep 2023 11:15:51 +0530 Subject: [PATCH] fix: docker build was failing due to incorrect installation of postgres --- .github/workflows/deploy.yml | 14 ++++++++------ Dockerfile | 9 ++++----- README.md | 10 ++++------ action.yml | 2 +- sample_project/requirements.txt | 2 +- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b6f796c..c0619e0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,11 +12,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: [3.6.10] - # python_version: [3.5.7, 3.6.10, 3.7.5, 3.8.2] + python_version: [3.7.17] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Django aws eb deployment uses: ./ with: @@ -33,21 +32,24 @@ jobs: flake8_config_file: "sample_project/.flake8" - name: Coverage report artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: coverage report path: output/coverage_report.txt + if-no-files-found: warn - name: Coverage report artifacts if failed - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 if: failure() with: name: coverage report if failed path: output/coverage_report.txt + if-no-files-found: warn - name: Security check report artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 if: failure() with: name: bandit path: output/security_report.txt + if-no-files-found: warn diff --git a/Dockerfile b/Dockerfile index 08c4164..c3e7dcc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,10 @@ FROM ubuntu:18.04 -RUN apt-get -y update && apt-get -y upgrade && apt-get -y install gnupg2 wget +RUN apt-get -y update && apt-get -y upgrade && apt-get -y install gnupg2 wget ca-certificates -RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list -RUN apt-get -y update && apt-get -y install software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 -RUN apt install -y ca-certificates +RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - +RUN apt-get update +RUN apt-get -y update && apt-get -y install software-properties-common postgresql-10 postgresql-client-10 postgresql-contrib-10 USER postgres diff --git a/README.md b/README.md index 696dcbf..6050cfa 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This action has the following features: ## Usage -It is **important** to have the Elastic beanstalk `config.yml` of your project with its AWS credentials. +It is **important** to have the Elastic beanstalk `config.yml` of your project with its AWS credentials. ```yml - name: Django aws eb deployment @@ -68,8 +68,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: [3.6.10] - # python_version: [3.5.7, 3.6.10, 3.7.5, 3.8.2] + python_version: [3.7.17] steps: - uses: actions/checkout@v2 @@ -117,7 +116,7 @@ In addition to the deployment options you must also configure the following. | Key | Value Information | Type | Required | Default | | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- | -------- | | `FLAKE8` | This boolean flag to whether to run flake8 linting for our project. | `with` | **No** | false | -| `PYTHON_VERSION` | Version range or exact version of a Python version to use, using SemVer's version range syntax. | `with` | **Yes** | 3.6.10 | +| `PYTHON_VERSION` | Version range or exact version of a Python version to use, using SemVer's version range syntax. | `with` | **Yes** | 3.7.17 | | `FLAKE8_CONFIG_FILE` | The flake8 config path relative to the github repository (this requires input flake8 to be true). | `with` | **No** | ".flake8" | | `DEPLOY` | Deploy to AWS Elastic beanstalk. | `with` | **Yes** | true | @@ -259,8 +258,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python_version: [3.6.10] - # python_version: [3.5.7, 3.6.10, 3.7.5, 3.8.2] + python_version: [3.7.17] steps: - uses: actions/checkout@v2 diff --git a/action.yml b/action.yml index 3a65e90..90ecb97 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: python_version: description: "Version range or exact version of a Python version to use, using SemVer's version range syntax." - default: "3.6.10" + default: "3.7.17" required: true aws_access_key_id: diff --git a/sample_project/requirements.txt b/sample_project/requirements.txt index 3b355fa..abae93a 100644 --- a/sample_project/requirements.txt +++ b/sample_project/requirements.txt @@ -1,3 +1,3 @@ -Django==2.2.20 +Django==2.2.28 psycopg2-binary django-environ \ No newline at end of file