From 1593e126eb5769237f9c312ee041db6b635f1030 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 20:31:19 +0200 Subject: [PATCH 01/32] add docker build files --- Dockerfile | 11 +++++++++++ dockerbuild.sh | 1 + 2 files changed, 12 insertions(+) create mode 100644 Dockerfile create mode 100755 dockerbuild.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e765732 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:alpine as Build +ENV NODE_ENV=production +WORKDIR /app + +COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ] +COPY server ./server + +RUN npm ci --omit=dev + +RUN npm run build +CMD ["npm","run","start"] diff --git a/dockerbuild.sh b/dockerbuild.sh new file mode 100755 index 0000000..c6ceae3 --- /dev/null +++ b/dockerbuild.sh @@ -0,0 +1 @@ +docker build --tag node-jellyfin-role-bot:latest . -- 2.40.1 From 8ee36f751092bef51f4cb510411d58a7cbb110d2 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 20:31:33 +0200 Subject: [PATCH 02/32] add woodpecker integration --- .woodpecker.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..b45705d --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,7 @@ +pipeline: + docker: + image: plugins/docker + settings: + registry: registry.brudi.xyz + repo: registry.brudi.xyz/kenobi/node-jellyfin-role-bot + tags: latest -- 2.40.1 From 6e0c3b8ef6bdb56d193d7cfcb3b56473601ec3a8 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 21:49:04 +0200 Subject: [PATCH 03/32] add gitea cicd --- .gitea/workflows/docker-build.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitea/workflows/docker-build.yaml diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml new file mode 100644 index 0000000..53790a2 --- /dev/null +++ b/.gitea/workflows/docker-build.yaml @@ -0,0 +1,8 @@ +name: Build a docker image for node-jellyfin-role-ot +run-name: ${{ gitea.actor }} is building an image + +jobs: + build-docker-image: + runs-on: node:alpine + steps: + - run: bash dockerbuild.sh -- 2.40.1 From 09f4efc96c3c3f29237ba73d138808d18a1dda8f Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 21:50:21 +0200 Subject: [PATCH 04/32] change os --- .gitea/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 53790a2..571de97 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -3,6 +3,6 @@ run-name: ${{ gitea.actor }} is building an image jobs: build-docker-image: - runs-on: node:alpine + runs-on: ubuntu-latest steps: - run: bash dockerbuild.sh -- 2.40.1 From 8ac4f568a01e93e3f4f6989f736cbc7a6e2823b4 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 21:51:26 +0200 Subject: [PATCH 05/32] add on push --- .gitea/workflows/docker-build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 571de97..7e6dd4c 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -1,5 +1,6 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image +on: [push] jobs: build-docker-image: -- 2.40.1 From 1970f4b0cba615a7e6a6be14af59c478eba0d48e Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 23:24:56 +0200 Subject: [PATCH 06/32] adjust docker build stage --- .gitea/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 7e6dd4c..c3a2311 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -6,4 +6,4 @@ jobs: build-docker-image: runs-on: ubuntu-latest steps: - - run: bash dockerbuild.sh + - run: ./dockerbuild.sh -- 2.40.1 From e3144fc402fbf291ffbb068d3957b479f080d339 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 23:29:03 +0200 Subject: [PATCH 07/32] add checkout option --- .gitea/workflows/docker-build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index c3a2311..368cef0 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -6,4 +6,8 @@ jobs: build-docker-image: runs-on: ubuntu-latest steps: - - run: ./dockerbuild.sh + + - name: Checkout repository + uses: actions/checkout@v3 + - name: use build script + run: ./dockerbuild.sh -- 2.40.1 From b67982ed3868624de7ed7fb5d559570fcd944d98 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 23:29:29 +0200 Subject: [PATCH 08/32] ls --- .gitea/workflows/docker-build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 368cef0..26a472d 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -6,7 +6,8 @@ jobs: build-docker-image: runs-on: ubuntu-latest steps: - + - name: ls + run: ls - name: Checkout repository uses: actions/checkout@v3 - name: use build script -- 2.40.1 From c8bfc47ddfe7e68ce6eefe98f2dbd9187d922f78 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 13 Jun 2023 23:47:22 +0200 Subject: [PATCH 09/32] add docker login --- .gitea/workflows/docker-build.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 26a472d..cff6052 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -6,9 +6,13 @@ jobs: build-docker-image: runs-on: ubuntu-latest steps: - - name: ls - run: ls - name: Checkout repository uses: actions/checkout@v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ secrets.REGISTRY }} + username: ${{ secrets.USER }} + password: ${{ secrets.DOCKER_TOKEN }} - name: use build script run: ./dockerbuild.sh -- 2.40.1 From 034d14eb152695a6da1f2826cff8da2d42512236 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 18:59:07 +0200 Subject: [PATCH 10/32] use a container with docker --- .gitea/workflows/docker-build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index cff6052..e77b487 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -5,6 +5,11 @@ on: [push] jobs: build-docker-image: runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + permissions: + contents: read + packages: write + steps: - name: Checkout repository uses: actions/checkout@v3 -- 2.40.1 From 2cb652aee65c44c09a93c7d46a44c1672e9e30ff Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:11:05 +0200 Subject: [PATCH 11/32] add metadata and registry push --- .gitea/workflows/docker-build.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index e77b487..ff0631f 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -21,3 +21,15 @@ jobs: password: ${{ secrets.DOCKER_TOKEN }} - name: use build script run: ./dockerbuild.sh + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ secrets.REGISTRY }}/node-jellyfin-role-bot + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} -- 2.40.1 From 83f803d0e791b5b1b09bfe4fe77d24cd26ec8c97 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:16:23 +0200 Subject: [PATCH 12/32] remove metadata action --- .gitea/workflows/docker-build.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index ff0631f..4886947 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -21,11 +21,6 @@ jobs: password: ${{ secrets.DOCKER_TOKEN }} - name: use build script run: ./dockerbuild.sh - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ secrets.REGISTRY }}/node-jellyfin-role-bot - name: Build and push Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: -- 2.40.1 From cd0c8c0017f9e7a79c48abe596516f918d068df5 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:18:46 +0200 Subject: [PATCH 13/32] latest tag by default --- .gitea/workflows/docker-build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 4886947..d81b9e1 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -26,5 +26,4 @@ jobs: with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: latest -- 2.40.1 From 934b6dfeaded6490e0608613607389b6a09e6ef5 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:21:22 +0200 Subject: [PATCH 14/32] remove custom script --- .gitea/workflows/docker-build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index d81b9e1..ed16d26 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -19,8 +19,6 @@ jobs: registry: ${{ secrets.REGISTRY }} username: ${{ secrets.USER }} password: ${{ secrets.DOCKER_TOKEN }} - - name: use build script - run: ./dockerbuild.sh - name: Build and push Docker image uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: -- 2.40.1 From bcf788293ec6ca3f9155a2e3cee1ea2d9340d4d5 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:27:28 +0200 Subject: [PATCH 15/32] hardcoded docker tags --- .gitea/workflows/docker-build.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index ed16d26..aebcfb6 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -13,15 +13,17 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@v2 with: - registry: ${{ secrets.REGISTRY }} + registry: gitea.brudi.xyz username: ${{ secrets.USER }} password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push Docker image - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v4 with: context: . push: true - tags: latest + tags: gitea.brudi.xyz/R2/node-jellyfin-role-bot:latest -- 2.40.1 From 31a9e0eb2899adf9ba7d3631390a98be677141c2 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 19:44:50 +0200 Subject: [PATCH 16/32] adjust url --- .gitea/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index aebcfb6..b8f5fd7 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -26,4 +26,4 @@ jobs: with: context: . push: true - tags: gitea.brudi.xyz/R2/node-jellyfin-role-bot:latest + tags: gitea.brudi.xyz/r2/jellyfin-discord-bot:latest -- 2.40.1 From 911b9e4884c9abb8d1f8b850192f765a692a772c Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 21:27:16 +0200 Subject: [PATCH 17/32] adjust pipeline to be personalized --- .gitea/workflows/docker-build.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index b8f5fd7..fecf233 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -2,6 +2,11 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image on: [push] +env: + REGISTRY: gitea.brudi.xyz + IMAGE_NAME: ${{ gitea.repository }} + USER: ${{ gitea.actor }} + jobs: build-docker-image: runs-on: ubuntu-latest @@ -18,12 +23,12 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v2 with: - registry: gitea.brudi.xyz - username: ${{ secrets.USER }} - password: ${{ secrets.DOCKER_TOKEN }} + registry: ${{ env.REGISTRY }} + username: ${{ env.USER }} + password: ${{ secrets.TOKEN }} - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . push: true - tags: gitea.brudi.xyz/r2/jellyfin-discord-bot:latest + tags: ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest -- 2.40.1 From 79ffde5f345c7b4a1c3e7612d73697ef0c7ee8c4 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 21:30:23 +0200 Subject: [PATCH 18/32] check env step --- .gitea/workflows/docker-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index fecf233..767d000 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -16,6 +16,8 @@ jobs: packages: write steps: + - name: Check environment + run: echo "Registry ${{ env.Registry }} Image ${{ env.IMAGE_NAME }} User ${{ env.USER }}" - name: Checkout repository uses: actions/checkout@v3 - name: Set up Docker Buildx -- 2.40.1 From c0f91aad79cdb03bd97a22875337307e6178809c Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 21:42:16 +0200 Subject: [PATCH 19/32] add secrets to 'on' --- .gitea/workflows/docker-build.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 767d000..8c9ad9f 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -1,6 +1,10 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image -on: [push] +on: + push: + secrets: + TOKEN: + required: true env: REGISTRY: gitea.brudi.xyz -- 2.40.1 From 26e74a62c12ff6151217066b702cec9a591b417a Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 21:54:22 +0200 Subject: [PATCH 20/32] add branch --- .gitea/workflows/docker-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 8c9ad9f..e3b73ff 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -2,6 +2,8 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image on: push: + branches: + - "feat/cicd" secrets: TOKEN: required: true -- 2.40.1 From 40d9523e218d82325e039b800ccefcf4685046d6 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:14:19 +0200 Subject: [PATCH 21/32] doing it manually --- .gitea/workflows/docker-build.yaml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index e3b73ff..9e32b33 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -26,17 +26,9 @@ jobs: run: echo "Registry ${{ env.Registry }} Image ${{ env.IMAGE_NAME }} User ${{ env.USER }}" - name: Checkout repository uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USER }} - password: ${{ secrets.TOKEN }} - - name: Build and push Docker image - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest + run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} + - name: Build Container + run: docker build -t ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest . + - name: Push Container + run: docker push ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest -- 2.40.1 From 33f031d333064f211a090ea9e0d8bc18fa992dc3 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:14:46 +0200 Subject: [PATCH 22/32] simplify push --- .gitea/workflows/docker-build.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 9e32b33..68b29a5 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -1,12 +1,6 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image -on: - push: - branches: - - "feat/cicd" - secrets: - TOKEN: - required: true +on: [push] env: REGISTRY: gitea.brudi.xyz -- 2.40.1 From 808bdd033e3a314eca9b3f42290b9bfcb737c96e Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:20:06 +0200 Subject: [PATCH 23/32] string it --- .gitea/workflows/docker-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 68b29a5..4810c42 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -23,6 +23,6 @@ jobs: - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: docker build -t ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest . + run: docker build -t "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" . - name: Push Container - run: docker push ${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest + run: docker push "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" -- 2.40.1 From 5dcf766593c400e4fa448c014c9ac61cae863b17 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:27:05 +0200 Subject: [PATCH 24/32] dockerbuild and dockerpush scripts --- dockerbuild.sh | 3 ++- dockerpush.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 dockerpush.sh diff --git a/dockerbuild.sh b/dockerbuild.sh index c6ceae3..c3c768d 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -1 +1,2 @@ -docker build --tag node-jellyfin-role-bot:latest . +#!/bin/bash +docker build --tag $1 . diff --git a/dockerpush.sh b/dockerpush.sh new file mode 100644 index 0000000..769084f --- /dev/null +++ b/dockerpush.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker push $1 -- 2.40.1 From 0cb19ba8f17f335bf1250799062077d8241d7d08 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:27:18 +0200 Subject: [PATCH 25/32] use bash scripts for docker stage --- .gitea/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 4810c42..21be96b 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -23,6 +23,6 @@ jobs: - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: docker build -t "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" . + run: ./dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" - name: Push Container run: docker push "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" -- 2.40.1 From 7e67d1fed9db3b394f103bb9318aa9145eabde09 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:28:29 +0200 Subject: [PATCH 26/32] adjust scripts --- .gitea/workflows/docker-build.yaml | 2 +- dockerbuild.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 21be96b..f2f904b 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -25,4 +25,4 @@ jobs: - name: Build Container run: ./dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" - name: Push Container - run: docker push "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" + run: ./dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" diff --git a/dockerbuild.sh b/dockerbuild.sh index c3c768d..b0dcbcc 100755 --- a/dockerbuild.sh +++ b/dockerbuild.sh @@ -1,2 +1,3 @@ #!/bin/bash +echo $1 docker build --tag $1 . -- 2.40.1 From 8540381834cddfe3ee43742f4cb6f5af87623057 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:29:55 +0200 Subject: [PATCH 27/32] use bash explicitly --- .gitea/workflows/docker-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index f2f904b..a86be88 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -23,6 +23,6 @@ jobs: - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: ./dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" + run: bash dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" - name: Push Container - run: ./dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" + run: bash dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" -- 2.40.1 From b7986d276b061e208ea3b0b672b77f215fa4076d Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:31:34 +0200 Subject: [PATCH 28/32] fix env access --- .gitea/workflows/docker-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index a86be88..d1801b8 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -23,6 +23,6 @@ jobs: - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: bash dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" + run: bash dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }}:latest" - name: Push Container - run: bash dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ IMAGE_NAME }}:latest" + run: bash dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }}:latest" -- 2.40.1 From 0d5799796abdfe813e6847ada2e7068eb57ddc4a Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:33:15 +0200 Subject: [PATCH 29/32] go back to normal docker commands --- .gitea/workflows/docker-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index d1801b8..5b29ac3 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -23,6 +23,6 @@ jobs: - name: Log in to the Container registry run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }} - name: Build Container - run: bash dockerbuild.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }}:latest" + run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" . - name: Push Container - run: bash dockerpush.sh "${{ env.REGISTRY }}/${{ env.USER }}/${{ env.IMAGE_NAME }}:latest" + run: docker push "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -- 2.40.1 From 749e1c89ab359b3ef769e24e7cfe4569adf6b27a Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:35:51 +0200 Subject: [PATCH 30/32] clean up ci yaml --- .gitea/workflows/docker-build.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index 5b29ac3..bd893be 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -1,12 +1,10 @@ name: Build a docker image for node-jellyfin-role-ot run-name: ${{ gitea.actor }} is building an image on: [push] - env: REGISTRY: gitea.brudi.xyz IMAGE_NAME: ${{ gitea.repository }} USER: ${{ gitea.actor }} - jobs: build-docker-image: runs-on: ubuntu-latest @@ -14,10 +12,7 @@ jobs: permissions: contents: read packages: write - steps: - - name: Check environment - run: echo "Registry ${{ env.Registry }} Image ${{ env.IMAGE_NAME }} User ${{ env.USER }}" - name: Checkout repository uses: actions/checkout@v3 - name: Log in to the Container registry -- 2.40.1 From f2b5ee502f5d3960b0cbd57b0b21a00c52b7455b Mon Sep 17 00:00:00 2001 From: mightypanders Date: Wed, 14 Jun 2023 22:35:59 +0200 Subject: [PATCH 31/32] remove unnecessary scripts --- .woodpecker.yml | 7 ------- dockerbuild.sh | 3 --- dockerpush.sh | 2 -- 3 files changed, 12 deletions(-) delete mode 100644 .woodpecker.yml delete mode 100755 dockerbuild.sh delete mode 100644 dockerpush.sh diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index b45705d..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,7 +0,0 @@ -pipeline: - docker: - image: plugins/docker - settings: - registry: registry.brudi.xyz - repo: registry.brudi.xyz/kenobi/node-jellyfin-role-bot - tags: latest diff --git a/dockerbuild.sh b/dockerbuild.sh deleted file mode 100755 index b0dcbcc..0000000 --- a/dockerbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -echo $1 -docker build --tag $1 . diff --git a/dockerpush.sh b/dockerpush.sh deleted file mode 100644 index 769084f..0000000 --- a/dockerpush.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -docker push $1 -- 2.40.1 From b3d3ed00525c1301831329f1e9fbaeb76810f0a6 Mon Sep 17 00:00:00 2001 From: magnetotail Date: Wed, 14 Jun 2023 22:40:40 +0200 Subject: [PATCH 32/32] Fix typo --- .gitea/workflows/docker-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml index bd893be..995fa23 100644 --- a/.gitea/workflows/docker-build.yaml +++ b/.gitea/workflows/docker-build.yaml @@ -1,4 +1,4 @@ -name: Build a docker image for node-jellyfin-role-ot +name: Build a docker image for node-jellyfin-role-bot run-name: ${{ gitea.actor }} is building an image on: [push] env: -- 2.40.1