From 485ecfc7b5314e5d0e83b3f4dc77f2d84e6801bf Mon Sep 17 00:00:00 2001 From: jhot Date: Wed, 1 Nov 2023 13:11:16 -0600 Subject: [PATCH] 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