with tasks

This commit is contained in:
Kasper Juul Hermansen 2022-10-29 19:06:50 +02:00
parent 165554ee15
commit 626e7bec93
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
2 changed files with 7 additions and 2 deletions

View File

@ -18,7 +18,7 @@ steps:
- mkdir -p tmp/dagger-go - mkdir -p tmp/dagger-go
- git clone "https://git.front.kjuulh.io/kjuulh/dagger-go.git" tmp/dagger-go - git clone "https://git.front.kjuulh.io/kjuulh/dagger-go.git" tmp/dagger-go
- docker build -t dagger-go-builder:${DRONE_COMMIT} -f tmp/dagger-go/Dockerfile . - docker build -t dagger-go-builder:${DRONE_COMMIT} -f tmp/dagger-go/Dockerfile .
- 'docker run -v /var/run/docker.sock:/var/run/docker.sock dagger-go-builder:${DRONE_COMMIT} ./dagger-go build {{ or .input.imageTag $imageTag }}' - 'docker run -v /var/run/docker.sock:/var/run/docker.sock dagger-go-builder:${DRONE_COMMIT} ./dagger-go build "{{ or .input.imageTag $imageTag }}"'
services: services:
- name: docker - name: docker

View File

@ -4,6 +4,7 @@ import (
"context" "context"
"log" "log"
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/tasks"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -23,7 +24,11 @@ func Build(requirementsf func(*cobra.Command), buildf func(ctx context.Context)
log.Printf("Building image: %s\n", imageTag) log.Printf("Building image: %s\n", imageTag)
} }
if buildf != nil {
return buildf(cmd.Context()) return buildf(cmd.Context())
}
return tasks.Build(imageTag)
}, },
} }