From 536a882a266d94e45eba8296b4f4427da2128a55 Mon Sep 17 00:00:00 2001 From: Marius <24592972+gilbN@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:25:49 +0100 Subject: [PATCH] Use git clone instead of svn on swag mod --- .../swag/root/etc/cont-init.d/98-themepark | 35 ++++++++----------- .../init-mod-themepark-add-package/run | 5 --- .../init-mod-themepark-add-package/type | 1 - .../s6-rc.d/init-mod-themepark-add-package/up | 1 - .../dependencies.d/init-mods | 0 .../dependencies.d/init-mods-package-install | 0 .../s6-overlay/s6-rc.d/init-mod-themepark/run | 22 ++++++++---- .../init-mod-themepark-add-package | 0 8 files changed, 30 insertions(+), 34 deletions(-) delete mode 100755 docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/run delete mode 100644 docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/type delete mode 100644 docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/up rename docker-mods/swag/root/etc/s6-overlay/s6-rc.d/{init-mod-themepark-add-package => init-mod-themepark}/dependencies.d/init-mods (100%) delete mode 100644 docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/dependencies.d/init-mods-package-install delete mode 100644 docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-themepark-add-package diff --git a/docker-mods/swag/root/etc/cont-init.d/98-themepark b/docker-mods/swag/root/etc/cont-init.d/98-themepark index 8f2e5733..5738bca5 100644 --- a/docker-mods/swag/root/etc/cont-init.d/98-themepark +++ b/docker-mods/swag/root/etc/cont-init.d/98-themepark @@ -4,19 +4,6 @@ echo '-------------------------' echo '| SWAG theme.park Mod |' echo '-------------------------' -if ! [[ -x "$(command -v svn)" ]]; then -echo '--------------------------' -echo '| Installing svn package |' -echo '--------------------------' - if [ -x "$(command -v apk)" ]; then - apk update && \ - apk add --no-cache subversion - elif [ -x "$(command -v apt-get)" ]; then - apt-get update && \ - apt-get install -y subversion - fi -fi - # Display variables for troubleshooting echo -e "Variables set:\\n\ 'TP_BRANCH'=${TP_BRANCH}\\n" @@ -41,7 +28,7 @@ fi mkdir -p /config/www/themepark -SHA_RELEASE=$(curl -sL "https://api.github.com/repos/gilbn/theme.park/commits/${TP_BRANCH}" | jq -r '.sha'); +SHA_RELEASE=$(curl -sL "https://api.github.com/repos/themepark-dev/theme.park/commits/${TP_BRANCH}" | jq -r '.sha'); if [[ ! -f "/config/www/themepark/sha.txt" ]]; then SHA="" else @@ -50,13 +37,21 @@ fi # Downloading fresh webui files from source. if [[ $SHA != $SHA_RELEASE ]]; then echo "-----------------------------------------------------" - echo "| Downloading latest files from ${TP_BRANCH} branch |" + echo "| Cloning latest files from ${TP_BRANCH} branch |" + echo "-----------------------------------------------------" + rm -rf /tmp/themepark + git clone --depth 1 --quiet --branch ${TP_BRANCH} https://github.com/themepark-dev/theme.park.git /tmp/themepark + echo "-----------------------------------------------------" + echo "| Copying files to /config/www/themepark |" + echo "-----------------------------------------------------" + cp -a /tmp/themepark/css /config/www/themepark/css + cp -a /tmp/themepark/resources /config/www/themepark/resources + cp -a /tmp/themepark/themes.json /config/www/themepark + cp -a /tmp/themepark/index.html /config/www/themepark + rm -rf /tmp/themepark + echo "-----------------------------------------------------" + echo '| Clone and copy finished |' echo "-----------------------------------------------------" - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/css" /config/www/themepark/css - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/resources" /config/www/themepark/resources - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/themes.json" /config/www/themepark - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/index.html" /config/www/themepark - printf '\nDownload finished\n\n' fi cat <<< "$SHA_RELEASE" > "/config/www/themepark/sha.txt" diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/run b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/run deleted file mode 100755 index a37649f8..00000000 --- a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/with-contenv bash - -if ! [[ -x "$(command -v svn)" ]]; then - echo "subversion" >> /mod-repo-packages-to-install.list -fi diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/type b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/type deleted file mode 100644 index 3d92b15f..00000000 --- a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/type +++ /dev/null @@ -1 +0,0 @@ -oneshot \ No newline at end of file diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/up b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/up deleted file mode 100644 index 12d7a60e..00000000 --- a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/up +++ /dev/null @@ -1 +0,0 @@ -/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/run \ No newline at end of file diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/dependencies.d/init-mods b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/dependencies.d/init-mods similarity index 100% rename from docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark-add-package/dependencies.d/init-mods rename to docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/dependencies.d/init-mods diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/dependencies.d/init-mods-package-install b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/dependencies.d/init-mods-package-install deleted file mode 100644 index e69de29b..00000000 diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run index b2162488..5738bca5 100755 --- a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run +++ b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mod-themepark/run @@ -28,7 +28,7 @@ fi mkdir -p /config/www/themepark -SHA_RELEASE=$(curl -sL "https://api.github.com/repos/gilbn/theme.park/commits/${TP_BRANCH}" | jq -r '.sha'); +SHA_RELEASE=$(curl -sL "https://api.github.com/repos/themepark-dev/theme.park/commits/${TP_BRANCH}" | jq -r '.sha'); if [[ ! -f "/config/www/themepark/sha.txt" ]]; then SHA="" else @@ -37,13 +37,21 @@ fi # Downloading fresh webui files from source. if [[ $SHA != $SHA_RELEASE ]]; then echo "-----------------------------------------------------" - echo "| Downloading latest files from ${TP_BRANCH} branch |" + echo "| Cloning latest files from ${TP_BRANCH} branch |" + echo "-----------------------------------------------------" + rm -rf /tmp/themepark + git clone --depth 1 --quiet --branch ${TP_BRANCH} https://github.com/themepark-dev/theme.park.git /tmp/themepark + echo "-----------------------------------------------------" + echo "| Copying files to /config/www/themepark |" + echo "-----------------------------------------------------" + cp -a /tmp/themepark/css /config/www/themepark/css + cp -a /tmp/themepark/resources /config/www/themepark/resources + cp -a /tmp/themepark/themes.json /config/www/themepark + cp -a /tmp/themepark/index.html /config/www/themepark + rm -rf /tmp/themepark + echo "-----------------------------------------------------" + echo '| Clone and copy finished |' echo "-----------------------------------------------------" - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/css" /config/www/themepark/css - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/resources" /config/www/themepark/resources - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/themes.json" /config/www/themepark - svn export --quiet --force "https://github.com/GilbN/theme.park/branches/${TP_BRANCH}/index.html" /config/www/themepark - printf '\nDownload finished\n\n' fi cat <<< "$SHA_RELEASE" > "/config/www/themepark/sha.txt" diff --git a/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-themepark-add-package b/docker-mods/swag/root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-themepark-add-package deleted file mode 100644 index e69de29b..00000000