2022-10-31 21:57:16 +01:00
|
|
|
type: docker
|
|
|
|
kind: pipeline
|
|
|
|
name: "drone-dagger-test"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "build"
|
2023-05-15 21:57:27 +02:00
|
|
|
image: harbor.front.kjuulh.io/docker-proxy/library/docker:dind
|
2022-10-31 21:57:16 +01:00
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
environment:
|
|
|
|
DOCKER_BUILDKIT: 1
|
2023-05-15 21:57:27 +02:00
|
|
|
HARBOR_DOCKER_HOST: "harbor.front.kjuulh.io"
|
2022-10-31 21:57:16 +01:00
|
|
|
HARBOR_DOCKER_USERNAME:
|
|
|
|
from_secret: "harbor_docker_username"
|
|
|
|
HARBOR_DOCKER_PASSWORD:
|
|
|
|
from_secret: "harbor_docker_password"
|
|
|
|
commands:
|
|
|
|
- sleep 5
|
|
|
|
- apk add git
|
|
|
|
- mkdir -p tmp/bust
|
|
|
|
- git clone "https://git.front.kjuulh.io/kjuulh/bust.git" tmp/bust
|
|
|
|
- >
|
|
|
|
echo "$${HARBOR_DOCKER_PASSWORD}" | docker login
|
|
|
|
--password-stdin
|
|
|
|
--username="$${HARBOR_DOCKER_USERNAME}"
|
|
|
|
"$${HARBOR_DOCKER_HOST}"
|
|
|
|
- >
|
2023-05-15 21:57:27 +02:00
|
|
|
docker pull harbor.front.kjuulh.io/kjuulh/bust-builder:${DRONE_COMMIT} ||
|
|
|
|
(docker build -t harbor.front.kjuulh.io/kjuulh/bust-builder:${DRONE_COMMIT} -f tmp/bust/Dockerfile . && docker push harbor.front.kjuulh.io/kjuulh/bust-builder:${DRONE_COMMIT})
|
2022-10-31 21:57:16 +01:00
|
|
|
- >
|
|
|
|
docker run
|
|
|
|
-e DRONE_REPO_NAME="${DRONE_REPO_NAME}"
|
|
|
|
-e HARBOR_DOCKER_HOST=$${HARBOR_DOCKER_HOST}
|
|
|
|
-e HARBOR_DOCKER_USERNAME=$${HARBOR_DOCKER_USERNAME}
|
|
|
|
-e HARBOR_DOCKER_PASSWORD=$${HARBOR_DOCKER_PASSWORD}
|
|
|
|
-v "$PWD/:/src/"
|
|
|
|
-v /var/run/docker.sock:/var/run/docker.sock
|
2023-05-15 21:57:27 +02:00
|
|
|
harbor.front.kjuulh.io/kjuulh/bust-builder:${DRONE_COMMIT}
|
2022-10-31 21:57:16 +01:00
|
|
|
sh -c 'echo "$$HARBOR_DOCKER_PASSWORD" | docker login
|
|
|
|
--password-stdin
|
|
|
|
--username="$$HARBOR_DOCKER_USERNAME"
|
|
|
|
"$${HARBOR_DOCKER_HOST}"
|
|
|
|
&& bust build golangbin'
|
|
|
|
|
|
|
|
services:
|
|
|
|
- name: docker
|
|
|
|
image: docker:dind
|
|
|
|
privileged: true
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
path: /var/run
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: dockersock
|
|
|
|
temp: {}
|