From 78d663bbb4d98bf2c554b298bcb505285d70b99c Mon Sep 17 00:00:00 2001 From: Trenton Holmes Date: Sat, 2 Apr 2022 08:48:58 -0700 Subject: [PATCH 1/3] Fixes the Docker image tags --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 014549847..22b90b5e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -196,9 +196,8 @@ jobs: images: ghcr.io/${{ github.repository }} tags: | type=match,pattern=ngx-(\d.\d.\d),group=1 - type=semver,pattern=ngx-{{version}} - type=semver,pattern=ngx-{{major}}.{{minor}} - type=ref + type=ref,event=branch + type=ref,event=tag - name: Checkout uses: actions/checkout@v3 From 6db3fc2eea84107f67534ec99e2ffe88bf3a9b32 Mon Sep 17 00:00:00 2001 From: Trenton Holmes Date: Fri, 1 Apr 2022 15:37:18 -0700 Subject: [PATCH 2/3] Fixes an issue where the install script wouldn't recognize docker compose v2 command --- install-paperless-ngx.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/install-paperless-ngx.sh b/install-paperless-ngx.sh index d9bea400a..acea3a525 100755 --- a/install-paperless-ngx.sh +++ b/install-paperless-ngx.sh @@ -47,24 +47,29 @@ if [[ $(id -u) == "0" ]] ; then exit 1 fi -if [[ -z $(which wget) ]] ; then +if ! command -v wget &> /dev/null ; then echo "wget executable not found. Is wget installed?" exit 1 fi -if [[ -z $(which docker) ]] ; then +if ! command -v docker &> /dev/null ; then echo "docker executable not found. Is docker installed?" exit 1 fi -if [[ -z $(which docker-compose) ]] ; then - echo "docker-compose executable not found. Is docker-compose installed?" - exit 1 +DOCKER_COMPOSE_CMD="docker-compose" +if ! command -v ${DOCKER_COMPOSE_CMD} ; then + { + docker compose version &> /dev/null && DOCKER_COMPOSE_CMD="docker compose" + } || { + echo "docker-compose executable not found. Is docker-compose installed?" + exit 1 + } fi # Check if user has permissions to run Docker by trying to get the status of Docker (docker status). # If this fails, the user probably does not have permissions for Docker. -if [ ! "$(docker stats --no-stream 2>/dev/null 1>&2)" ] ; then +if ! docker stats --no-stream &> /dev/null ; then echo "" echo "WARN: It look like the current user does not have Docker permissions." echo "WARN: Use 'sudo usermod -aG docker $USER' to assign Docker permissions to the user." @@ -351,8 +356,8 @@ if [ "$l1" -eq "$l2" ] ; then fi -docker-compose pull +${DOCKER_COMPOSE_CMD} pull -docker-compose run --rm -e DJANGO_SUPERUSER_PASSWORD="$PASSWORD" webserver createsuperuser --noinput --username "$USERNAME" --email "$EMAIL" +${DOCKER_COMPOSE_CMD} run --rm -e DJANGO_SUPERUSER_PASSWORD="$PASSWORD" webserver createsuperuser --noinput --username "$USERNAME" --email "$EMAIL" -docker-compose up -d +${DOCKER_COMPOSE_CMD} up -d From 6aa9071e24a3d7ee635a08383da9cb45a352e0a7 Mon Sep 17 00:00:00 2001 From: Trenton Holmes Date: Sat, 2 Apr 2022 14:34:11 -0700 Subject: [PATCH 3/3] Converts the docker compose check to use if statement --- install-paperless-ngx.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install-paperless-ngx.sh b/install-paperless-ngx.sh index acea3a525..1eb689c85 100755 --- a/install-paperless-ngx.sh +++ b/install-paperless-ngx.sh @@ -59,12 +59,12 @@ fi DOCKER_COMPOSE_CMD="docker-compose" if ! command -v ${DOCKER_COMPOSE_CMD} ; then - { - docker compose version &> /dev/null && DOCKER_COMPOSE_CMD="docker compose" - } || { + if docker compose version &> /dev/null ; then + DOCKER_COMPOSE_CMD="docker compose" + else echo "docker-compose executable not found. Is docker-compose installed?" exit 1 - } + fi fi # Check if user has permissions to run Docker by trying to get the status of Docker (docker status).