Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker build was failing due to incorrect installation of postgres #32

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 |

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion sample_project/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django==2.2.20
Django==2.2.28
psycopg2-binary
django-environ