Remove setup step
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
74f3400cc7
commit
18613e2b73
33
.drone.yml
33
.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:
|
||||
|
@ -81,5 +64,3 @@ volumes:
|
|||
path: /var/run/docker.sock
|
||||
- name: docker
|
||||
temp: {}
|
||||
- name: usrbin
|
||||
temp: {}
|
13
Taskfile.yml
13
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"}}'
|
||||
|
|
Loading…
Reference in New Issue