From 71ed8fd46695a6d6b7130a77965901d9f396b76c Mon Sep 17 00:00:00 2001 From: jld3103 Date: Mon, 28 Aug 2023 09:17:11 +0200 Subject: [PATCH] refactor(tool): Pin app versions Signed-off-by: jld3103 --- tool/Dockerfile.dev | 17 +++++++++++++---- tool/dev/install_app_version | 9 +++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100755 tool/dev/install_app_version diff --git a/tool/Dockerfile.dev b/tool/Dockerfile.dev index d37f3858..112f251d 100644 --- a/tool/Dockerfile.dev +++ b/tool/Dockerfile.dev @@ -1,4 +1,6 @@ -FROM nextcloud:27.0.0@sha256:a4181a159a0eb4d33cf7c5a05a24ca39c1ff6b7df29a125b5e47ab2ea2863bd1 +ARG SERVER_VERSION=27.0.0@sha256:a4181a159a0eb4d33cf7c5a05a24ca39c1ff6b7df29a125b5e47ab2ea2863bd1 +FROM nextcloud:$SERVER_VERSION + WORKDIR /usr/src/nextcloud RUN chown -R www-data:www-data . USER www-data @@ -12,9 +14,16 @@ RUN OC_PASS="user1" ./occ user:add --password-from-env --display-name "User One" RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" user2 RUN OC_PASS="demo" ./occ user:add --password-from-env --display-name "Demo" demo -RUN ./occ app:install --force --allow-unstable news -RUN ./occ app:install --force --allow-unstable notes -RUN ./occ app:install --force --allow-unstable uppush +ADD dev/install_app_version /usr/local/bin/ + +ARG NEWS_VERSION=23.0.0 +RUN install_app_version news https://github.com/nextcloud/news/releases/download/$NEWS_VERSION/news.tar.gz + +ARG NOTES_VERSION=4.8.1 +RUN install_app_version notes https://github.com/nextcloud-releases/notes/releases/download/v$NOTES_VERSION/notes.tar.gz + +ARG UPPUSH_VERSION=1.4.0 +RUN install_app_version uppush https://codeberg.org/NextPush/uppush/archive/$UPPUSH_VERSION.tar.gz RUN ./occ app:enable password_policy RUN (sh /entrypoint.sh php -S 0.0.0.0:8080 &) && \ diff --git a/tool/dev/install_app_version b/tool/dev/install_app_version new file mode 100755 index 00000000..c0d7c2cb --- /dev/null +++ b/tool/dev/install_app_version @@ -0,0 +1,9 @@ +#!/bin/bash +set -euxo pipefail + +app="$1" +url="$2" + +cd /usr/src/nextcloud +curl -L "$url" | tar -xz -C "apps" +./occ app:enable "$app"