From 02655bac9933052002f04a001be33f6a97905dc4 Mon Sep 17 00:00:00 2001 From: Tom Eley Date: Thu, 13 Apr 2023 20:57:20 +0100 Subject: [PATCH 01/13] sha256 linux --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 57069a3c..e0e5c808 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-17acebe3-ls14 +FROM ghcr.io/linuxserver/baseimage-alpine@sha256:0c07a583b2466d85d92cbebff3b72a6c471cc8662fae9df50b3241e5d1db26d5 # Set the maintainer LABEL maintainer="GhostWriters" From 739827b80ceed7bb4f68bd4acdc4baf049d76a18 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 13 Apr 2023 21:09:13 +0100 Subject: [PATCH 02/13] 3.17 version fix (#61) Co-authored-by: Tom Eley --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e0e5c808..f8835d5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine@sha256:0c07a583b2466d85d92cbebff3b72a6c471cc8662fae9df50b3241e5d1db26d5 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # Set the maintainer LABEL maintainer="GhostWriters" From 0f05bf202422a08bfeb80c87572fc594fa607cf1 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 20:50:54 +0100 Subject: [PATCH 03/13] Fix for getting config if not present (#62) Co-authored-by: Tom Eley --- Dockerfile | 2 +- renovate.json | 9 +++++++++ root/opt/docker-entrypoint.sh | 13 +++++++------ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8835d5a..c10723a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls16 # Set the maintainer LABEL maintainer="GhostWriters" diff --git a/renovate.json b/renovate.json index c5c1d0d9..ede851e8 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], + "docker": { + "registryUrl": "docker.io", + "baseImage": ["linuxserver/docker-baseimage-alpine"] + }, + "schedule": ["every day"], + "labels": ["docker"], + "matchDatasource": [ + "docker|alpine|linuxserver/docker-baseimage-alpine:3\\.\\d{2}-[a-f0-9]{8}-ls\\d{2}" + ], "automerge": true } diff --git a/root/opt/docker-entrypoint.sh b/root/opt/docker-entrypoint.sh index 58669480..5e8ea42d 100755 --- a/root/opt/docker-entrypoint.sh +++ b/root/opt/docker-entrypoint.sh @@ -2,24 +2,25 @@ CFG=/config/configFile.cfg -# This copies the sample config if one is not present in the config dir +# Downloads and copies a new configfile template if one is not present in the config dir. if [ ! -f $CFG ]; then echo 'No config file, providing sample' - cp /root/Packt-Publishing-Free-Learning/src/configFileTemplate.cfg $CFG + wget -O $CFG https://gitlab.com/packt-cli/packt-cli/-/raw/master/configFileTemplate.cfg fi -# If environment arguments have been provided, switch the values in the sample config to these + +# If environment arguments have been provided, switch the values in the config to these. if [ -n "$PACKT_EMAIL" ]; then echo 'ENV PACKT_EMAIL provided' sed -i s/email=.*/email="$PACKT_EMAIL"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKT_EMAIL not set' fi if [ -n "$PACKT_PASSWORD" ]; then echo 'ENV PACKT_PASSWORD provided' sed -i s/password=.*/password="$PACKT_PASSWORD"/ $CFG else - echo 'ENV PACKTEMAIL not set' + echo 'ENV PACKT_PASSWORD not set' fi if [ -n "$PACKT_DOWNLOAD_FORMATS" ]; then @@ -50,5 +51,5 @@ sed -i s@download_folder_path:.*@download_folder_path:\ \\/data@ $CFG echo 'Set logfile path to /data' sed -i s@ebook_extra_info_log_file_path:.*@ebook_extra_info_log_file_path:\ \\/data\\/eBookMetadata.log@ $CFG -echo 'Start crond' +echo 'Start crond in the foreground' crond -f From fce739f9b6c9375916c1773ef8642d122cd9ddfb Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 17 Apr 2023 21:08:02 +0100 Subject: [PATCH 04/13] Fix for getting config if not present (#63) Co-authored-by: Tom Eley --- renovate.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/renovate.json b/renovate.json index ede851e8..ea058819 100644 --- a/renovate.json +++ b/renovate.json @@ -1,14 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "docker": { - "registryUrl": "docker.io", - "baseImage": ["linuxserver/docker-baseimage-alpine"] - }, "schedule": ["every day"], - "labels": ["docker"], - "matchDatasource": [ - "docker|alpine|linuxserver/docker-baseimage-alpine:3\\.\\d{2}-[a-f0-9]{8}-ls\\d{2}" - ], "automerge": true } From de56989cc93a3f7b3df5ef52fb7623f59ff293b8 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 07:42:41 +0100 Subject: [PATCH 05/13] renovate fix (#65) Co-authored-by: Tom Eley --- Dockerfile | 2 +- renovate.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c10723a5..f8835d5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Set the base image -FROM ghcr.io/linuxserver/baseimage-alpine:3.17-a17cd2f4-ls16 +FROM ghcr.io/linuxserver/baseimage-alpine:3.17 # Set the maintainer LABEL maintainer="GhostWriters" diff --git a/renovate.json b/renovate.json index ea058819..c5c1d0d9 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,5 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["config:base"], - "schedule": ["every day"], "automerge": true } From 964441de46d3bb90566b4cde1130c03475d6d743 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:30:26 +0000 Subject: [PATCH 06/13] Update docker/metadata-action action to v4.4.0 --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 30b0f158..e74d915f 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0 + uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0 with: images: | ${{ github.repository }} From b8dcb9e58818ad06da25e9bcdc0a9ba68e32c22d Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 18 Apr 2023 21:07:53 +0100 Subject: [PATCH 07/13] Changed badges (#67) Co-authored-by: Tom Eley --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 896d9af0..55b7023e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ # Container for Packt daily download script -[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) -[![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) -[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GhostWriters/docker-packt/Mega-Linter/main?style=flat-square&color=607D8B&logo=github)](https://github.com/GhostWriters/docker-packt-cli/actions?query=workflow%3AMega-Linter+branch%3Amain) +[![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) +[![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt-cli/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) +[![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) +[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://renovatebot.com) These instructions detail how to set up a docker container that includes a scheduled cron job to automatically claim the daily free book from Packt at 1am each night. Packt offers free learning e-books each day, and you can find more information about this service -at . To learn more about docker, please visit the official documentation at -. If you're new to cron jobs, you can learn more about them on the Unix/Linux man -pages at . For more information about the code used in this container, please see the +at . +To learn more about docker, please visit the official documentation at . +If you're new to cron jobs, you can learn more about them on the Unix/Linux manpages at . +For more information about the code used in this container, please see the project page at . ## Run From a11f45b1dada4108122830537e954b9533ca051a Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 18:03:21 +0100 Subject: [PATCH 08/13] Fix Badge (#68) Co-authored-by: Tom Eley --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55b7023e..d3dab420 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![GitHub contributors](https://img.shields.io/github/contributors/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/graphs/contributors) [![GitHub last commit main](https://img.shields.io/github/last-commit/GhostWriters/docker-packt-cli/main.svg?style=flat-square&color=607D8B&label=code%20committed)](https://github.com/GhostWriters/docker-packt-cli/commits/main) [![GitHub license](https://img.shields.io/github/license/GhostWriters/docker-packt-cli.svg?style=flat-square&color=607D8B)](https://github.com/GhostWriters/docker-packt-cli/blob/main/LICENSE) -[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://renovatebot.com) +[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square&color=607D8B)](https://github.com/renovatebot/renovate) These instructions detail how to set up a docker container that includes a scheduled cron job to automatically claim the daily free book from Packt at 1am each night. Packt offers free learning e-books each day, and you can find more information about this service From 9210298eb3b1f5977befc3bdcfc242e1315193c5 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 19:34:33 +0100 Subject: [PATCH 09/13] Bump version (#69) Co-authored-by: Tom Eley --- .github/workflows/deploy-docker-image.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index e74d915f..29a35456 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -15,6 +15,15 @@ jobs: steps: # Checks out the main branch of the repository to the runner - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + with: + fetch-depth: "0" + + # This action creates a new git tag of the main branch with the new version number + - name: Bump version and push tag + uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true # Sets up the QEMU emulator that emulates different architectures - name: Set up QEMU From e2b056cc4e2b254e4922f81f899e8901080deec4 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Apr 2023 21:20:18 +0100 Subject: [PATCH 10/13] Added action to create a release (#70) --- .github/workflows/deploy-docker-image.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 29a35456..fb32f0a5 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -50,7 +50,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker - id: meta + id: metadata uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0 with: images: | @@ -69,5 +69,11 @@ jobs: context: . push: true platforms: linux/amd64,linux/arm64,linux/arm/v7 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + + # Create a release based on the new tag + - name: Create release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e6a148f27a4511e961e9aba8c6424c4bd2368235 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 17:58:01 +0100 Subject: [PATCH 11/13] Add tag for release (#71) --- .github/workflows/deploy-docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index fb32f0a5..28a66c87 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -20,6 +20,7 @@ jobs: # This action creates a new git tag of the main branch with the new version number - name: Bump version and push tag + id: tag uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -75,5 +76,7 @@ jobs: # Create a release based on the new tag - name: Create release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + with: + tag_name: ${{ steps.tag.outputs.tag_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b33618a50530944022d51e2118d5721f9ff0d849 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:21:49 +0100 Subject: [PATCH 12/13] bumpTag (#72) --- .github/workflows/deploy-docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 28a66c87..5ddc5f53 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -20,7 +20,7 @@ jobs: # This action creates a new git tag of the main branch with the new version number - name: Bump version and push tag - id: tag + id: bumpTag uses: anothrNick/github-tag-action@d77194f92b4ca48b05df5c20709984535a9cd6e0 # v1.62.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -77,6 +77,6 @@ jobs: - name: Create release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 with: - tag_name: ${{ steps.tag.outputs.tag_name }} + tag_name: ${{ steps.bumpTag.outputs.new_tag }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dd2167d6bf01a95869f2a4d44deb7d2c5274e208 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 20 Apr 2023 18:46:27 +0100 Subject: [PATCH 13/13] Changed action Token (#73) --- .github/workflows/deploy-docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker-image.yml b/.github/workflows/deploy-docker-image.yml index 5ddc5f53..18a6bca4 100644 --- a/.github/workflows/deploy-docker-image.yml +++ b/.github/workflows/deploy-docker-image.yml @@ -79,4 +79,4 @@ jobs: with: tag_name: ${{ steps.bumpTag.outputs.new_tag }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }}