From f7ac88c96a920164b396700a35f1f6401f365663 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 19 Nov 2024 20:32:48 +0000 Subject: [PATCH] refactor: :recycle: refacto makefile and add docker --- .dockerignore | 23 +++++++++++++++++++++++ Dockerfile | 21 +++++++++++++++++++++ Makefile | 31 +++++++++++++++++++++++++------ appinfo/info.xml | 8 ++++---- 4 files changed, 73 insertions(+), 10 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ee929f9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln + +.marginalia + +js/ +build/ +coverage/ +utils/docker-ci + +vendor/ +.php-cs-fixer.cache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fd9687f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM nextcloud:30 + +ARG APP_NAME=radio +ENV NEXTCLOUD_UPDATE=1 +ENV NEXTCLOUD_ADMIN_USER=$APP_NAME +ENV NEXTCLOUD_ADMIN_PASSWORD=$APP_NAME +ENV NEXTCLOUD_INIT_HTACCESS=1 +ENV SQLITE_DATABASE=$APP_NAME + +RUN apt-get update && \ + apt-get install -y nodejs npm sqlite3 && \ + rm -f /usr/local/etc/php/conf.d/opcache-recommended.ini && \ + /entrypoint.sh true + +USER www-data + +COPY --chown=www-data:www-data . apps/$APP_NAME +RUN php occ app:enable $APP_NAME && \ + php occ config:system:set debug --value=true + +USER root diff --git a/Makefile b/Makefile index 2cbc217..6fd8def 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: dev-setup lint build-js-production test # Dev env management -dev-setup: clean clean-dev npm-init +dev-setup: clean clean-dev composer-init npm-init npm-init: npm ci @@ -12,6 +12,12 @@ npm-init: npm-update: npm update +composer-init: + composer install + +composer-update: + composer update + # Building build-js: npm run dev @@ -52,16 +58,29 @@ clean: clean-dev: rm -rf node_modules + rm -rf vendor release: krankerl package translations: - if [ ! -d "utils/docker-ci" ]; then \ - git clone https://github.com/nextcloud/docker-ci.git utils/docker-ci; \ - fi - php utils/docker-ci/translations/translationtool/translationtool.phar create-pot-files - php utils/docker-ci/translations/translationtool/translationtool.phar convert-po-files + docker run --rm \ + -v $(PWD):/app \ + --entrypoint php \ + nextcloudci/translations \ + /translationtool.phar create-pot-files + docker run --rm \ + -v $(PWD):/app \ + --entrypoint php \ + nextcloudci/translations \ + /translationtool.phar convert-po-files + +dev: dev-setup + docker stop radio || true + docker rm radio || true + docker build -t radio . + docker run -itd --rm --name radio -v $(PWD):/var/www/html/apps/radio -p 80:80 radio + npm run watch publish-appstore-nightly: $(eval ASSET_URL = $(shell curl -s https://git.project-insanity.org/api/v4/projects/onny%2Fnextcloud-app-radio/releases | jq -r '.[0].assets.links[0].url')) diff --git a/appinfo/info.xml b/appinfo/info.xml index 0fc2251..bc64ad0 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -16,17 +16,17 @@ app uses radio-browser.info database as a backend. - 👂 Smoth audio playback and transitions - 1.1.0 + 2.0.0 agpl - Jonas Heinrich + Jonas Heinrich Radio multimedia https://git.project-insanity.org/onny/nextcloud-app-radio https://git.project-insanity.org/onny/nextcloud-app-radio/issues https://git.project-insanity.org/onny/nextcloud-app-radio/raw/master/screenshot.png - - + +