with log statement

This commit is contained in:
Kasper Juul Hermansen 2022-10-30 20:46:13 +01:00
parent 7cb736fa33
commit bfa0eba29d
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 9 additions and 20 deletions

View File

@ -10,6 +10,8 @@ import (
) )
func main() { func main() {
log.Printf("building dagger-go")
err := cli.NewCustomGoBuild("golangbin", func(ctx context.Context) error { err := cli.NewCustomGoBuild("golangbin", func(ctx context.Context) error {
builder, err := builder.New(ctx) builder, err := builder.New(ctx)
if err != nil { if err != nil {

View File

@ -4,7 +4,7 @@ name: "drone-dagger-test"
steps: steps:
- name: "build" - name: "build"
image: harbor.front.kjuulh.io/docker-proxy/library/docker:dind image: harbor.front.kjuulh.io/kjuulh/dagger-go:latest
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
@ -17,25 +17,9 @@ steps:
from_secret: "harbor_docker_password" from_secret: "harbor_docker_password"
commands: commands:
- sleep 5 - sleep 5
echo "$${HARBOR_DOCKER_PASSWORD}" | docker login - ls -la /usr/bin
--password-stdin - cp /usr/bin/dagger-go /dagger-go
--username="$${HARBOR_DOCKER_USERNAME}" - sh -c "/dagger-go build golangbin"
"$${HARBOR_DOCKER_HOST}"
- docker pull harbor.front.kjuulh.io/kjuulh/dagger-go:latest
- >
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
harbor.front.kjuulh.io/kjuulh/dagger-go:latest
sh -c 'echo "$$HARBOR_DOCKER_PASSWORD" | docker login
--password-stdin
--username="$$HARBOR_DOCKER_USERNAME"
"$${HARBOR_DOCKER_HOST}"
&& dagger-go build golangbin'
services: services:
- name: docker - name: docker
@ -48,3 +32,6 @@ services:
volumes: volumes:
- name: dockersock - name: dockersock
temp: {} temp: {}
image_pull_secrets:
- dockerconfig