From 7bdf52f83faa23e0cc7a6e4aa0fb046989b1d05f Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 18 May 2021 15:21:20 +0200 Subject: [PATCH] Make drone more readable --- .drone.yml | 56 ++---------------------------------------------------- convert.sh | 8 ++++++++ upload.sh | 6 ++++++ 3 files changed, 16 insertions(+), 54 deletions(-) create mode 100644 convert.sh create mode 100644 upload.sh diff --git a/.drone.yml b/.drone.yml index b099144..b0ace92 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,63 +19,11 @@ steps: commands: - apt-get update - apt-get install -y --no-install-recommends calibre - - ebook-polish -fpuiU "output/L'auberge Vagabonde - Volume 1.epub" "output/L'auberge Vagabonde - Volume 1.epub" - - ebook-polish -fpuiU "output/L'auberge Vagabonde - Volume 2.epub" "output/L'auberge Vagabonde - Volume 2.epub" - - ebook-polish -fpuiU "output/L'auberge Vagabonde - Volume 3.epub" "output/L'auberge Vagabonde - Volume 3.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 3.epub" "output/The Wandering Inn - Volume 3.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 4.epub" "output/The Wandering Inn - Volume 4.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 5.epub" "output/The Wandering Inn - Volume 5.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 6.epub" "output/The Wandering Inn - Volume 6.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 7.epub" "output/The Wandering Inn - Volume 7.epub" - - ebook-polish -fpuiU "output/The Wandering Inn - Volume 8.epub" "output/The Wandering Inn - Volume 8.epub" - - ebook-convert "output/L'auberge Vagabonde - Volume 1.epub" "output/L'auberge Vagabonde - Volume 1.pdf" - - ebook-convert "output/L'auberge Vagabonde - Volume 2.epub" "output/L'auberge Vagabonde - Volume 2.pdf" - - ebook-convert "output/L'auberge Vagabonde - Volume 3.epub" "output/L'auberge Vagabonde - Volume 3.pdf" - - ebook-convert "output/The Wandering Inn - Volume 3.epub" "output/The Wandering Inn - Volume 3.pdf" - - ebook-convert "output/The Wandering Inn - Volume 4.epub" "output/The Wandering Inn - Volume 4.pdf" - - ebook-convert "output/The Wandering Inn - Volume 5.epub" "output/The Wandering Inn - Volume 5.pdf" - - ebook-convert "output/The Wandering Inn - Volume 6.epub" "output/The Wandering Inn - Volume 6.pdf" - - ebook-convert "output/The Wandering Inn - Volume 7.epub" "output/The Wandering Inn - Volume 7.pdf" - - ebook-convert "output/The Wandering Inn - Volume 8.epub" "output/The Wandering Inn - Volume 8.pdf" - - ebook-convert "output/L'auberge Vagabonde - Volume 1.epub" "output/L'auberge Vagabonde - Volume 1.mobi" - - ebook-convert "output/L'auberge Vagabonde - Volume 2.epub" "output/L'auberge Vagabonde - Volume 2.mobi" - - ebook-convert "output/L'auberge Vagabonde - Volume 3.epub" "output/L'auberge Vagabonde - Volume 3.mobi" - - ebook-convert "output/The Wandering Inn - Volume 3.epub" "output/The Wandering Inn - Volume 3.mobi" - - ebook-convert "output/The Wandering Inn - Volume 4.epub" "output/The Wandering Inn - Volume 4.mobi" - - ebook-convert "output/The Wandering Inn - Volume 5.epub" "output/The Wandering Inn - Volume 5.mobi" - - ebook-convert "output/The Wandering Inn - Volume 6.epub" "output/The Wandering Inn - Volume 6.mobi" - - ebook-convert "output/The Wandering Inn - Volume 7.epub" "output/The Wandering Inn - Volume 7.mobi" - - ebook-convert "output/The Wandering Inn - Volume 8.epub" "output/The Wandering Inn - Volume 8.mobi" + - bash -x convert.sh - name: upload image: curlimages/curl commands: - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 1.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 1.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 2.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 2.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 3.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 3.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 3.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 3.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 4.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 4.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 5.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 5.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 6.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 6.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 7.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 7.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 8.epub" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 8.epub" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 1.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 1.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 2.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 2.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 3.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 3.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 3.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 3.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 4.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 4.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 5.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 5.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 6.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 6.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 7.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 7.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 8.pdf" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 8.pdf" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 1.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 1.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 2.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 2.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/L'auberge Vagabonde - Volume 3.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/L'auberge Vagabonde - Volume 3.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 3.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 3.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 4.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 4.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 5.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 5.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 6.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 6.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 7.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 7.mobi" - - curl -Ss -u "$USER":"$PASS" -T "output/The Wandering Inn - Volume 8.mobi" "https://cloud.crystalyx.net/remote.php/dav/files/$USER/Public/TWI/The Wandering Inn - Volume 8.mobi" + - bash -x upload.sh environment: USER: from_secret: nextcloud_user diff --git a/convert.sh b/convert.sh new file mode 100644 index 0000000..5bd8428 --- /dev/null +++ b/convert.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +for FILE in output/* +do + ebook-polish -fpuiU "${FILE}" "${FILE}" + ebook-convert "${FILE}" "${FILE%.*}.pdf" + ebook-convert "${FILE}" "${FILE%.*}.mobi" +done diff --git a/upload.sh b/upload.sh new file mode 100644 index 0000000..9ddc2a0 --- /dev/null +++ b/upload.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +for FILE in output/* +do + curl -Ss -u "${USER}":"${PASS}" -T "${FILE}" "https://cloud.crystalyx.net/remote.php/dav/files/${USER}/Public/TWI/${FILE##*/}" +done