From 68af7a3b20295a496775d48f3b0538325deaa013 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 10:42:53 +0200 Subject: [PATCH 01/32] Moved to python image --- Dockerfile | 5 ++--- entrypoint.sh | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b9ee29..773a63c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz gcc +FROM python:3 -RUN python3 -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django +RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 71c8e5e..7271bca 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed -set -eu +set -eux # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) @@ -27,10 +27,10 @@ _git_changed() { # PROGRAM echo "Installing dependencies..." -pip3 install --no-cache-dir -r $INPUT_PIP_PATH +pip install --no-cache-dir -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH -python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH +python manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH # To keep runtime good, just continue if something was changed if _git_changed; From a701ca41c51a7e6f800e08b4a6a32058105f78e9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 10:49:17 +0200 Subject: [PATCH 02/32] Moved to windowservercore --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 773a63c..9d7a910 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3 - +FROM python:3.9.0-windowsservercore +RUN setup.exe -q -n -P openssh git graphviz gcc RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh From 88bd3eb64935e29675075cf2d22090869f7648e6 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 10:53:37 +0200 Subject: [PATCH 03/32] Debugging using ubuntu --- Dockerfile | 4 ++-- entrypoint.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9d7a910..f3ac37f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.9.0-windowsservercore -RUN setup.exe -q -n -P openssh git graphviz gcc +FROM ubuntu:latest +RUN apt update && apt install --no-cache bash git openssh graphviz gcc RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 7271bca..7cb2ea3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,6 +25,8 @@ _git_changed() { [[ -n "$(git status -s)" ]] } +python --version + # PROGRAM echo "Installing dependencies..." pip install --no-cache-dir -r $INPUT_PIP_PATH From 1660ca00d2c99388a29a3df26f2a2d9a9ad6348a Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 10:55:48 +0200 Subject: [PATCH 04/32] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f3ac37f..0b4ec45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:latest -RUN apt update && apt install --no-cache bash git openssh graphviz gcc +RUN apt update && apt install bash git openssh graphviz gcc RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh From ba78d9c707faf074d0889520498d3b4c45921cd8 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 10:58:18 +0200 Subject: [PATCH 05/32] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0b4ec45..258b61c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:latest -RUN apt update && apt install bash git openssh graphviz gcc +RUN apt update && apt install bash git openssh-client graphviz gcc RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh From a5cc4e546832c40c85e51820ad6efca8ce31ccc9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 11:00:54 +0200 Subject: [PATCH 06/32] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 258b61c..bfcf568 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:latest -RUN apt update && apt install bash git openssh-client graphviz gcc +RUN apt update && apt install -y bash git openssh-client graphviz gcc RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django COPY entrypoint.sh /entrypoint.sh From 33e6c5c07356ef505f3ff71b62dd467815ecb875 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 11:03:13 +0200 Subject: [PATCH 07/32] Update Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bfcf568..2d76518 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM ubuntu:latest -RUN apt update && apt install -y bash git openssh-client graphviz gcc -RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot django-extensions django +FROM alpine:3.12 +RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz gcc +RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From 72b0e8297decf749d914321be26c0690909c4b26 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 11:04:50 +0200 Subject: [PATCH 08/32] Fixed bug with the python name --- Dockerfile | 2 +- entrypoint.sh | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2d76518..eb30d4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.12 RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz gcc -RUN python -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django +RUN python3 -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 7cb2ea3..165de16 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,14 +25,12 @@ _git_changed() { [[ -n "$(git status -s)" ]] } -python --version - # PROGRAM echo "Installing dependencies..." -pip install --no-cache-dir -r $INPUT_PIP_PATH +pip3 install --no-cache-dir -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH -python manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH +python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH # To keep runtime good, just continue if something was changed if _git_changed; From 690136f5927dab1f2e55fc84b6690d43bd9f1810 Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 11:09:41 +0200 Subject: [PATCH 09/32] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index eb30d4a..f0228af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz gcc +RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz graphviz-dev gcc RUN python3 -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django COPY entrypoint.sh /entrypoint.sh From 70db1bdc397025abf4da49adb1c92aed76ca328e Mon Sep 17 00:00:00 2001 From: Conrad Date: Tue, 20 Oct 2020 11:17:52 +0200 Subject: [PATCH 10/32] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0228af..565cd1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git openssh python3 py3-pip graphviz graphviz-dev gcc +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev RUN python3 -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django COPY entrypoint.sh /entrypoint.sh From 1310f15c3d04a457c38c3803e5348c98eeb8bb80 Mon Sep 17 00:00:00 2001 From: creyD Date: Thu, 29 Oct 2020 15:01:55 +0100 Subject: [PATCH 11/32] New try removing the python dependencies --- Dockerfile | 1 - entrypoint.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 565cd1c..c4bce97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM alpine:3.12 RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev -RUN python3 -m pip install --upgrade pip setuptools wheel pyparsing pydot pygraphviz django-extensions django COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 165de16..1e5d00d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,7 @@ _git_changed() { # PROGRAM echo "Installing dependencies..." -pip3 install --no-cache-dir -r $INPUT_PIP_PATH +pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH From 3e4e529a21609338728bbba69a685d0ec430157d Mon Sep 17 00:00:00 2001 From: creyD Date: Thu, 29 Oct 2020 15:47:03 +0100 Subject: [PATCH 12/32] Added necessary dependency --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c4bce97..f0dfd21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From da6e513b3afbad089396b7c1c330909a3a00925f Mon Sep 17 00:00:00 2001 From: creyD Date: Thu, 29 Oct 2020 15:55:58 +0100 Subject: [PATCH 13/32] Added build dependencies --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f0dfd21..cbfa276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev build-base python3-dev libffi-dev openssl-dev COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From b52a4524089419cde85139f32670e1551bee43a9 Mon Sep 17 00:00:00 2001 From: creyD Date: Fri, 6 Nov 2020 09:41:03 +0100 Subject: [PATCH 14/32] Merged parameters on git commit --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1e5d00d..1658be5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -38,7 +38,7 @@ then # Calling method to configure the git environemnt _git_setup # Commit and push changes back - git commit -a -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" + git commit -am "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" git push origin echo "Changes pushed successfully." else From 5c2949e038b20a34ce20a3616466b19b7f511747 Mon Sep 17 00:00:00 2001 From: Conrad Date: Wed, 10 Feb 2021 18:49:48 +0100 Subject: [PATCH 15/32] Upgrading pip before the action runs --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 1658be5..66e53bd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,6 +27,7 @@ _git_changed() { # PROGRAM echo "Installing dependencies..." +pip3 install -U pip pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH From 89fbc0403bb6b006faeb70b505e385c2df1d0338 Mon Sep 17 00:00:00 2001 From: creyD Date: Wed, 10 Feb 2021 19:44:31 +0100 Subject: [PATCH 16/32] Bumped alpine version --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cbfa276..4227987 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -FROM alpine:3.12 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev build-base python3-dev libffi-dev openssl-dev - +FROM alpine:3.13.1 +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev build-base python3-dev libffi-dev openssl-dev cargo COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From f5ffd2f04c5c3dc9804122628e007fe2a1de8c26 Mon Sep 17 00:00:00 2001 From: Conrad Date: Sun, 14 Feb 2021 00:58:38 +0100 Subject: [PATCH 17/32] Default installing pydot --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 66e53bd..4abd7a2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,7 @@ _git_changed() { # PROGRAM echo "Installing dependencies..." -pip3 install -U pip +pip3 install -U pip pip3 pyparsing pydot pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH From 1c2cef08ae835ed48259509a13b87d1fd49fa480 Mon Sep 17 00:00:00 2001 From: Conrad Date: Sun, 14 Feb 2021 00:59:46 +0100 Subject: [PATCH 18/32] Added wheel to default installs --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 4abd7a2..4cd98ba 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,7 +27,7 @@ _git_changed() { # PROGRAM echo "Installing dependencies..." -pip3 install -U pip pip3 pyparsing pydot +pip3 install -U pip wheel pyparsing pydot pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." cd $INPUT_PROJECT_PATH From 3453c9394d4c47899716b295ba6b0e700d27c6a9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Sun, 14 Feb 2021 12:43:37 +0100 Subject: [PATCH 19/32] Removed cargo from dependencies --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4227987..2e7692e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM alpine:3.13.1 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev build-base python3-dev libffi-dev openssl-dev cargo +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev python3-dev build-base libffi-dev openssl-dev COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From d095959190ee76d8ff381ee0db34172d5d714428 Mon Sep 17 00:00:00 2001 From: Conrad Date: Sun, 14 Feb 2021 13:16:54 +0100 Subject: [PATCH 20/32] Removed dependencies for now --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2e7692e..34d0d7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ FROM alpine:3.13.1 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev python3-dev build-base libffi-dev openssl-dev +RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev python3-dev build-base COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From a94ac16063e9523bd38cc01637e00213d51d6cad Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 11:43:26 +0200 Subject: [PATCH 21/32] Build container from a different image --- Dockerfile | 5 +++-- entrypoint.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 34d0d7a..87f1f6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM alpine:3.13.1 -RUN apk update && apk add --no-cache bash git gcc openssh python3 py3-pip graphviz graphviz-dev musl-dev postgresql-dev python3-dev build-base +FROM python:3.10-slim-bullseye +RUN apt-get update -y && apt-get install -y --no-install-recommends bash git openssh graphviz graphviz-dev musl-dev postgresql-dev build-base build-essential gcc python3-dev libffi-dev poppler-utils zlib1g-dev libjpeg-dev libssl-dev && apt-get clean && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint.sh + ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 4cd98ba..bb62965 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,10 +25,10 @@ _git_changed() { [[ -n "$(git status -s)" ]] } -# PROGRAM echo "Installing dependencies..." pip3 install -U pip wheel pyparsing pydot pip3 install -r $INPUT_PIP_PATH + echo "Creating data model..." cd $INPUT_PROJECT_PATH python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH From 2e97cfb79808db46345093978a38b9dd19f2b5c9 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:14:48 +0200 Subject: [PATCH 22/32] Updated docs --- LICENSE | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 45f5732..5ac269e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 noah UG +Copyright (c) 2020 noah GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 98f92c8..32fdebf 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ on: - master jobs: - prettier: + graph-models: runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: ref: ${{ github.head_ref }} - name: Generate Data Schema - uses: noah-software/django_action@v1.0 + uses: noah-software/django_action@v1.1 with: # This part is also where you can pass other options, for example: pip_path: testfolder/app/requirements.txt From f765dad8a2d6288136e81924f1ba0f05171ee300 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:16:50 +0200 Subject: [PATCH 23/32] Removed non existing dependencies --- Dockerfile | 3 ++- entrypoint.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 87f1f6c..11dc3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.10-slim-bullseye -RUN apt-get update -y && apt-get install -y --no-install-recommends bash git openssh graphviz graphviz-dev musl-dev postgresql-dev build-base build-essential gcc python3-dev libffi-dev poppler-utils zlib1g-dev libjpeg-dev libssl-dev && apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN apt-get update -y && apt-get install -y --no-install-recommends bash git graphviz graphviz-dev musl-dev build-essential gcc python3-dev libffi-dev poppler-utils zlib1g-dev libjpeg-dev libssl-dev && apt-get clean && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index bb62965..156bf95 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,6 +27,7 @@ _git_changed() { echo "Installing dependencies..." pip3 install -U pip wheel pyparsing pydot +pip3 install Django django-extensions pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." From 562d2759996b6c0f3a514ce509d71015fd24f158 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:24:05 +0200 Subject: [PATCH 24/32] Added graphviz as dependency --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 156bf95..7ae22a3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,7 +26,7 @@ _git_changed() { } echo "Installing dependencies..." -pip3 install -U pip wheel pyparsing pydot +pip3 install -U pip wheel pyparsing graphviz pydot pip3 install Django django-extensions pip3 install -r $INPUT_PIP_PATH From c1371a0f899cec7b1391d90cd5636e0beafb1d7f Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:29:46 +0200 Subject: [PATCH 25/32] Removed pydot dependencies --- Dockerfile | 2 +- entrypoint.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 11dc3b3..e0362e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.10-slim-bullseye -RUN apt-get update -y && apt-get install -y --no-install-recommends bash git graphviz graphviz-dev musl-dev build-essential gcc python3-dev libffi-dev poppler-utils zlib1g-dev libjpeg-dev libssl-dev && apt-get clean && rm -rf /var/lib/apt/lists/* +RUN apt-get update -y && apt-get install -y --no-install-recommends bash git graphviz graphviz-dev musl-dev build-essential gcc && apt-get clean && rm -rf /var/lib/apt/lists/* COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh index 7ae22a3..59e89c4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed -set -eux +set -eu # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) @@ -26,8 +26,7 @@ _git_changed() { } echo "Installing dependencies..." -pip3 install -U pip wheel pyparsing graphviz pydot -pip3 install Django django-extensions +pip3 install -U pip wheel pygraphviz pip3 install -r $INPUT_PIP_PATH echo "Creating data model..." From 645d8b7d48ab54272b90458b817484ae2130906e Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:33:30 +0200 Subject: [PATCH 26/32] Readded x for the script actions --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 59e89c4..16bfcf3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,7 @@ #!/bin/sh # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed -set -eu +set -eux # FUNCTIONS # Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) From 2794f9277d0470dbdc32886d6cfc37581e570093 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:41:14 +0200 Subject: [PATCH 27/32] Adjusted git check --- entrypoint.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 16bfcf3..855e58d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -20,11 +20,6 @@ EOF git config --global user.name "GitHub Action" } -# Checks if any files are changed -_git_changed() { - [[ -n "$(git status -s)" ]] -} - echo "Installing dependencies..." pip3 install -U pip wheel pygraphviz pip3 install -r $INPUT_PIP_PATH @@ -34,7 +29,7 @@ cd $INPUT_PROJECT_PATH python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH # To keep runtime good, just continue if something was changed -if _git_changed; +if [[ `$(git status -s)` ]]; then # Calling method to configure the git environemnt _git_setup From 3532070f3121647313c626261af8ed05fc4f1b89 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 13:46:36 +0200 Subject: [PATCH 28/32] Changed to bash shell --- entrypoint.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 855e58d..801436c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set # x would be for showing the commands before they are executed set -eux @@ -29,8 +29,7 @@ cd $INPUT_PROJECT_PATH python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH # To keep runtime good, just continue if something was changed -if [[ `$(git status -s)` ]]; -then +if [[ `git status --porcelain` ]]; then # Calling method to configure the git environemnt _git_setup # Commit and push changes back From cdbf90b6cb6ffa64dd5b765831ff9a8367d66fae Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 14:05:59 +0200 Subject: [PATCH 29/32] Changed variables to bash style --- entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 801436c..9e45627 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,11 +8,11 @@ set -eux _git_setup ( ) { cat <<- EOF > $HOME/.netrc machine github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN + login "$GITHUB_ACTOR" + password "$GITHUB_TOKEN" machine api.github.com - login $GITHUB_ACTOR - password $GITHUB_TOKEN + login "$GITHUB_ACTOR" + password "$GITHUB_TOKEN" EOF chmod 600 $HOME/.netrc @@ -22,11 +22,11 @@ EOF echo "Installing dependencies..." pip3 install -U pip wheel pygraphviz -pip3 install -r $INPUT_PIP_PATH +pip3 install -r "$INPUT_PIP_PATH" echo "Creating data model..." -cd $INPUT_PROJECT_PATH -python3 manage.py graph_models -a -g -o $INPUT_OUTPUT_PATH +cd "$INPUT_PROJECT_PATH" +python3 manage.py graph_models -a -g -o "$INPUT_OUTPUT_PATH" # To keep runtime good, just continue if something was changed if [[ `git status --porcelain` ]]; then From 99619906181f94233b00673e4914ea28fe67a23e Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 14:11:40 +0200 Subject: [PATCH 30/32] Removed git setup --- entrypoint.sh | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9e45627..aa98f2b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,23 +3,6 @@ # x would be for showing the commands before they are executed set -eux -# FUNCTIONS -# Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) -_git_setup ( ) { - cat <<- EOF > $HOME/.netrc - machine github.com - login "$GITHUB_ACTOR" - password "$GITHUB_TOKEN" - machine api.github.com - login "$GITHUB_ACTOR" - password "$GITHUB_TOKEN" -EOF - chmod 600 $HOME/.netrc - - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Action" -} - echo "Installing dependencies..." pip3 install -U pip wheel pygraphviz pip3 install -r "$INPUT_PIP_PATH" @@ -30,8 +13,6 @@ python3 manage.py graph_models -a -g -o "$INPUT_OUTPUT_PATH" # To keep runtime good, just continue if something was changed if [[ `git status --porcelain` ]]; then - # Calling method to configure the git environemnt - _git_setup # Commit and push changes back git commit -am "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" git push origin From a9d1874c6d3bf9c44fabdfae59d52ea17a2bbd87 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 14:16:56 +0200 Subject: [PATCH 31/32] Readded first part of git setup --- entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index aa98f2b..21f3ab4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,13 @@ # x would be for showing the commands before they are executed set -eux +# FUNCTIONS +# Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh) +_git_setup ( ) { + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Action" +} + echo "Installing dependencies..." pip3 install -U pip wheel pygraphviz pip3 install -r "$INPUT_PIP_PATH" @@ -13,6 +20,8 @@ python3 manage.py graph_models -a -g -o "$INPUT_OUTPUT_PATH" # To keep runtime good, just continue if something was changed if [[ `git status --porcelain` ]]; then + # Calling method to configure the git environemnt + _git_setup # Commit and push changes back git commit -am "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" git push origin From c045cd21a1d58a0d39b441f729ad12c8062da155 Mon Sep 17 00:00:00 2001 From: Conrad Date: Mon, 11 Jul 2022 14:20:12 +0200 Subject: [PATCH 32/32] Added git output path --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 21f3ab4..c020619 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -23,6 +23,7 @@ if [[ `git status --porcelain` ]]; then # Calling method to configure the git environemnt _git_setup # Commit and push changes back + git add "$INPUT_OUTPUT_PATH" git commit -am "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" git push origin echo "Changes pushed successfully."