From 8a8fe0032717c367ab36e89b077a0fb065eeef4e Mon Sep 17 00:00:00 2001 From: jhot Date: Tue, 31 Oct 2023 15:37:36 -0600 Subject: [PATCH 01/17] Drone build init --- .drone.yml | 13 +++++++++++++ Taskfile.yml | 7 ++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b3424c1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,13 @@ +kind: pipeline +type: docker +name: ci + +steps: +- name: build + image: debian:12 + commands: + - echo $${DRONE_TAG:-$DRONE_REPO_BRANCH} + # - apt-get update && apt-get install -y curl + # - curl -fsSL https://get.docker.com -o get-docker.sh + # - sh ./get-docker.sh + # - docker buildx build --platform linux/amd64,linux/arm64 -t \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index f5b86c4..3f06784 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,12 +4,11 @@ vars: NAME: code.jhot.me/jhot/docker-s3-backup tasks: - default: - vars: - TAG: latest build: cmds: - docker buildx build --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . + vars: + TAG: '{{.TAG | default "latest"}}' push: cmds: - docker push "{{.NAME}}:{{.TAG}}" @@ -18,3 +17,5 @@ tasks: cmds: - git tag "{{.TAG}}" - git push origin "{{.TAG}}" + vars: + TAG: '{{.TAG | default "latest"}}' -- 2.40.1 From ff4f2753384bcdd9459b2a9dfd027d08ceb6db27 Mon Sep 17 00:00:00 2001 From: jhot Date: Tue, 31 Oct 2023 15:40:15 -0600 Subject: [PATCH 02/17] Use correct var --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b3424c1..ac1ba7d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ steps: - name: build image: debian:12 commands: - - echo $${DRONE_TAG:-$DRONE_REPO_BRANCH} + - echo $${DRONE_TAG:-$DRONE_BRANCH} # - apt-get update && apt-get install -y curl # - curl -fsSL https://get.docker.com -o get-docker.sh # - sh ./get-docker.sh -- 2.40.1 From 73788158fb414eff48fa3ea15d64f57e11570cad Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 08:48:52 -0600 Subject: [PATCH 03/17] Try an actual docker build --- .drone.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index ac1ba7d..29b3c80 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,9 @@ steps: - name: build image: debian:12 commands: - - echo $${DRONE_TAG:-$DRONE_BRANCH} - # - apt-get update && apt-get install -y curl - # - curl -fsSL https://get.docker.com -o get-docker.sh - # - sh ./get-docker.sh - # - docker buildx build --platform linux/amd64,linux/arm64 -t \ No newline at end of file + - $TAG=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name + - apt-get update && apt-get install -y curl # install dependencies from apt + - curl -fsSL https://get.docker.com -o get-docker.sh # install docker + - sh ./get-docker.sh + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task + - .bin/task build # build the docker image \ No newline at end of file -- 2.40.1 From f5a8ad3386fd35902fe53fccd27d856b1f617e48 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 08:51:08 -0600 Subject: [PATCH 04/17] Didn't need that dollar sign --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 29b3c80..dce0704 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,7 +6,7 @@ steps: - name: build image: debian:12 commands: - - $TAG=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name + - TAG=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh -- 2.40.1 From 11e3a291bfaf0514c813898f14dea2a71cd781ef Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 08:53:28 -0600 Subject: [PATCH 05/17] Fix task path --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index dce0704..15ba85b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,4 +11,4 @@ steps: - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - - .bin/task build # build the docker image \ No newline at end of file + - ./bin/task build # build the docker image \ No newline at end of file -- 2.40.1 From 7bfbbbd4855c0a143fe1d1d371a72695722862d1 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:03:33 -0600 Subject: [PATCH 06/17] Mount docker socket --- .drone.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 15ba85b..d19194a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,10 +5,18 @@ name: ci steps: - name: build image: debian:12 + volumes: + - name: dockersocket + path: /var/run/docker.sock commands: - TAG=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - - ./bin/task build # build the docker image \ No newline at end of file + - ./bin/task build # build the docker image + +volumes: +- name: dockersocket + host: + path: /var/run/docker.sock \ No newline at end of file -- 2.40.1 From f2a5531bc902d40fe734c8475f5177959a984f93 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:11:20 -0600 Subject: [PATCH 07/17] Setup buildx --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index d19194a..866d661 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,6 +13,7 @@ steps: - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh + - docker buildx create --name builder --use - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - ./bin/task build # build the docker image -- 2.40.1 From b5c6392c343e40066ebad96861ca9272c061e966 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:15:49 -0600 Subject: [PATCH 08/17] Unique builder name --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 866d661..da89f4b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,7 @@ steps: - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - - docker buildx create --name builder --use + - docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - ./bin/task build # build the docker image -- 2.40.1 From 1f9d5664746d4ff7beeedbe19c6061148d5452b4 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:43:44 -0600 Subject: [PATCH 09/17] Multiple steps --- .drone.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index da89f4b..d93a1ed 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,21 +3,67 @@ type: docker name: ci steps: -- name: build +- name: setup image: debian:12 volumes: + - name: system + path: / - name: dockersocket path: /var/run/docker.sock commands: - - TAG=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - ./bin/task build # build the docker image +- name: build + image: debian:12 + volumes: + - name: system + path: / + - name: dockersocket + path: /var/run/docker.sock + commands: + - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name + - ./bin/task build TAG=$tag # build the docker image +- name: publish tag + image: debian:12 + environment: + PASSOWRD: + from_secret: FORGEJO_PASSWORD + volumes: + - name: system + path: / + - name: dockersocket + path: /var/run/docker.sock + commands: + - docker login -u drone -p ${PASSWORD} + - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name + - ./bin/task push TAG=$tag + when: + event: + - tag +- name: publish main + image: debian:12 + environment: + PASSOWRD: + from_secret: FORGEJO_PASSWORD + volumes: + - name: system + path: / + - name: dockersocket + path: /var/run/docker.sock + commands: + - docker login -u drone -p ${PASSWORD} + - ./bin/task push TAG=main + when: + branch: + - main volumes: - name: dockersocket host: - path: /var/run/docker.sock \ No newline at end of file + path: /var/run/docker.sock +- name: system + temp: {} \ No newline at end of file -- 2.40.1 From f4e78814c0c6599e6fa944a7ccf883c9f4951dcb Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:48:49 -0600 Subject: [PATCH 10/17] Cache not the whole world --- .drone.yml | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index d93a1ed..a9fc167 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,8 +6,10 @@ steps: - name: setup image: debian:12 volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: @@ -15,32 +17,36 @@ steps: - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d # install task - - ./bin/task build # build the docker image + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task + # - task build # build the docker image - name: build image: debian:12 volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - - ./bin/task build TAG=$tag # build the docker image + - task build TAG=$tag # build the docker image - name: publish tag image: debian:12 environment: PASSOWRD: from_secret: FORGEJO_PASSWORD volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - docker login -u drone -p ${PASSWORD} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - - ./bin/task push TAG=$tag + - task push TAG=$tag when: event: - tag @@ -50,13 +56,15 @@ steps: PASSOWRD: from_secret: FORGEJO_PASSWORD volumes: - - name: system - path: / + - name: docker + path: /var/lib/docker + - name: usrbin + path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: - docker login -u drone -p ${PASSWORD} - - ./bin/task push TAG=main + - task push TAG=main when: branch: - main @@ -65,5 +73,7 @@ volumes: - name: dockersocket host: path: /var/run/docker.sock -- name: system +- name: docker + temp: {} +- name: usrbin temp: {} \ No newline at end of file -- 2.40.1 From 8ed1e1579c15eb28c45664f0c3fe13b925945b7f Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:52:24 -0600 Subject: [PATCH 11/17] Depends --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index a9fc167..c5e9ac4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,6 +21,8 @@ steps: # - task build # build the docker image - name: build image: debian:12 + depends_on: + - setup volumes: - name: docker path: /var/lib/docker @@ -33,6 +35,8 @@ steps: - task build TAG=$tag # build the docker image - name: publish tag image: debian:12 + depends_on: + - build environment: PASSOWRD: from_secret: FORGEJO_PASSWORD @@ -52,6 +56,8 @@ steps: - tag - name: publish main image: debian:12 + depends_on: + - build environment: PASSOWRD: from_secret: FORGEJO_PASSWORD -- 2.40.1 From 74f3400cc7b1bd9c67206702b53583b5557a2305 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 09:53:37 -0600 Subject: [PATCH 12/17] builder name fix --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c5e9ac4..f7a22af 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,7 @@ steps: - apt-get update && apt-get install -y curl # install dependencies from apt - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - sh ./get-docker.sh - - docker buildx create --name ${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use + - docker buildx create --name builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task # - task build # build the docker image - name: build -- 2.40.1 From 18613e2b739524ae29325fca06e935809950226e Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 10:04:39 -0600 Subject: [PATCH 13/17] Remove setup step --- .drone.yml | 33 +++++++-------------------------- Taskfile.yml | 13 +++++++++++++ 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index f7a22af..e26b69a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,34 +3,17 @@ type: docker name: ci steps: -- name: setup - image: debian:12 - volumes: - - name: docker - path: /var/lib/docker - - name: usrbin - path: /usr/bin - - name: dockersocket - path: /var/run/docker.sock - commands: - - apt-get update && apt-get install -y curl # install dependencies from apt - - curl -fsSL https://get.docker.com -o get-docker.sh # install docker - - sh ./get-docker.sh - - docker buildx create --name builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} --use - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task - # - task build # build the docker image - name: build image: debian:12 - depends_on: - - setup volumes: - name: docker path: /var/lib/docker - - name: usrbin - path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task + - task setup-docker + - task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task build TAG=$tag # build the docker image - name: publish tag @@ -43,11 +26,11 @@ steps: volumes: - name: docker path: /var/lib/docker - - name: usrbin - path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task + - task setup-docker - docker login -u drone -p ${PASSWORD} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task push TAG=$tag @@ -64,11 +47,11 @@ steps: volumes: - name: docker path: /var/lib/docker - - name: usrbin - path: /usr/bin - name: dockersocket path: /var/run/docker.sock commands: + - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task + - task setup-docker - docker login -u drone -p ${PASSWORD} - task push TAG=main when: @@ -80,6 +63,4 @@ volumes: host: path: /var/run/docker.sock - name: docker - temp: {} -- name: usrbin temp: {} \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 3f06784..626b13d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -19,3 +19,16 @@ tasks: - git push origin "{{.TAG}}" vars: TAG: '{{.TAG | default "latest"}}' + setup-docker: + preconditions: + - sh: '[ "$UID" -eq 0 ]' + msg: Task must be run as root + cmds: + - apt-get update && apt-get install -y curl + - curl -fsSL https://get.docker.com -o /tmp/get-docker.sh + - sh /tmp/get-docker.sh + setup-buildx: + cmds: + - docker buildx create --name {{.BUILDER_NAME}} --use + vars: + BUILDER_NAME: '{{.BUILDER_NAME | default "mybuilder"}}' -- 2.40.1 From 485ecfc7b5314e5d0e83b3f4dc77f2d84e6801bf Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 13:11:16 -0600 Subject: [PATCH 14/17] Use new builder image --- .drone.yml | 21 +++++++++------------ Taskfile.yml | 8 -------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.drone.yml b/.drone.yml index e26b69a..ca7bb60 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,20 +4,18 @@ name: ci steps: - name: build - image: debian:12 + image: code.jhot.me/drone-users/drone-builder-image:main volumes: - name: docker path: /var/lib/docker - name: dockersocket path: /var/run/docker.sock commands: - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task - - task setup-docker - task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task build TAG=$tag # build the docker image - name: publish tag - image: debian:12 + image: code.jhot.me/drone-users/drone-builder-image:main depends_on: - build environment: @@ -29,16 +27,14 @@ steps: - name: dockersocket path: /var/run/docker.sock commands: - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task - - task setup-docker - - docker login -u drone -p ${PASSWORD} + - docker login -u drone -p $PASSWORD - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task push TAG=$tag when: event: - tag - name: publish main - image: debian:12 + image: code.jhot.me/drone-users/drone-builder-image:main depends_on: - build environment: @@ -50,9 +46,7 @@ steps: - name: dockersocket path: /var/run/docker.sock commands: - - sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/bin # install task - - task setup-docker - - docker login -u drone -p ${PASSWORD} + - docker login -u drone -p $PASSWORD - task push TAG=main when: branch: @@ -63,4 +57,7 @@ volumes: host: path: /var/run/docker.sock - name: docker - temp: {} \ No newline at end of file + temp: {} + +image_pull_secrets: +- dockerconfig \ No newline at end of file diff --git a/Taskfile.yml b/Taskfile.yml index 626b13d..4ca6084 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -19,14 +19,6 @@ tasks: - git push origin "{{.TAG}}" vars: TAG: '{{.TAG | default "latest"}}' - setup-docker: - preconditions: - - sh: '[ "$UID" -eq 0 ]' - msg: Task must be run as root - cmds: - - apt-get update && apt-get install -y curl - - curl -fsSL https://get.docker.com -o /tmp/get-docker.sh - - sh /tmp/get-docker.sh setup-buildx: cmds: - docker buildx create --name {{.BUILDER_NAME}} --use -- 2.40.1 From 0fb32a4f1d0add7dcc3dbb71fee83fd0882bd2fd Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 13:18:01 -0600 Subject: [PATCH 15/17] Load flag --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 4ca6084..4e5ed44 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,7 +6,7 @@ vars: tasks: build: cmds: - - docker buildx build --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . + - docker buildx build --load --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . vars: TAG: '{{.TAG | default "latest"}}' push: -- 2.40.1 From 0153aa1699444dc2c1a10277f8be4f0a71423218 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 13:24:31 -0600 Subject: [PATCH 16/17] Just rebuild to simplify things --- Taskfile.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 4e5ed44..93519a3 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,12 +6,14 @@ vars: tasks: build: cmds: - - docker buildx build --load --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . + - docker buildx build --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . vars: TAG: '{{.TAG | default "latest"}}' push: cmds: - - docker push "{{.NAME}}:{{.TAG}}" + - docker buildx build --push --platform linux/amd64,linux/arm64 -t "{{.NAME}}:{{.TAG}}" . + vars: + TAG: '{{.TAG | default "latest"}}' tag: prompt: This will push a git tag and docker image versioned {{.TAG}}... Do you want to continue? cmds: -- 2.40.1 From 9afb606576655992c7dead4d4204eb53374bab44 Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 13:25:16 -0600 Subject: [PATCH 17/17] Remove forgejo action --- .forgejo/workflows/build.yaml | 49 ----------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .forgejo/workflows/build.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml deleted file mode 100644 index d3ffa16..0000000 --- a/.forgejo/workflows/build.yaml +++ /dev/null @@ -1,49 +0,0 @@ -on: - push: - branches: - - main - tags: - - v[0-9]* - pull_request: - branches: - - main - -jobs: - build_and_test: - runs_on: docker - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v3 - - name: Dependenies - run: | - curl -fsSL https://get.docker.com -o get-docker.sh - sh ./get-docker.sh - - name: Set up Docker Buildx - uses: https://github.com/docker/setup-buildx-action@v2.10.0 - with: - endpoint: tcp://192.168.0.5:2375 - - name: Docker metadata - id: meta - uses: https://github.com/docker/metadata-action@v4.6.0 - with: - images: code.jhot.me/jhot/docker-s3-backup - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - - name: Login to DockerHub - if: github.event_name != 'pull_request' - uses: https://github.com/docker/login-action@v2.2.0 - with: - registry: code.jhot.me - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v4.2.1 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} -- 2.40.1