with default
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2022-10-31 22:35:36 +01:00
parent aa7036f10f
commit c6c42c4d08
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
6 changed files with 56 additions and 5 deletions

View File

@ -16,6 +16,9 @@ var gobinDefault embed.FS
//go:embed templates/docker/*
var docker embed.FS
//go:embed templates/default/*
var defaultFs embed.FS
func NewInitCmd() *cobra.Command {
var (
template string
@ -40,6 +43,11 @@ func NewInitCmd() *cobra.Command {
return err
}
break
case "default":
if err := initializeTemplate(&defaultFs, "default", name); err != nil {
return err
}
break
default:
return errors.New("could not find matching templates, please run [bust template ls] instead")
}

View File

@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)
var templates = []string{"docker", "gobin_default"}
var templates = []string{"docker", "gobin_default", "default"}
func NewLsCmd() *cobra.Command {
return &cobra.Command{

View File

@ -0,0 +1,4 @@
kind: template
load: bust_default_template.yaml
name: [[.Name]]
data: {}

View File

@ -0,0 +1,40 @@
type: docker
kind: pipeline
name: "drone-dagger-test"
steps:
- name: "build"
image: harbor.server.kjuulh.io/kjuulh/bust:1667250488156
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_BUILDKIT: 1
HARBOR_DOCKER_HOST: "harbor.server.kjuulh.io"
HARBOR_DOCKER_USERNAME:
from_secret: "harbor_docker_username"
HARBOR_DOCKER_PASSWORD:
from_secret: "harbor_docker_password"
commands:
- sleep 5
- >
echo "$${HARBOR_DOCKER_PASSWORD}" | docker login
--password-stdin
--username="$${HARBOR_DOCKER_USERNAME}"
"$${HARBOR_DOCKER_HOST}"
- bust build default
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
image_pull_secrets:
- dockerconfig

View File

@ -4,7 +4,7 @@ name: "drone-dagger-test"
steps:
- name: "build"
image: harbor.server.kjuulh.io/kjuulh/bust:1667244085545
image: harbor.server.kjuulh.io/kjuulh/bust:1667250488156
volumes:
- name: dockersock
path: /var/run

View File

@ -7,8 +7,7 @@ function add_template() {
drone template update --namespace "${namespace}" --name "${name}" --data "@${name}"
}
add_template kjuulh bust_default_template.yaml
add_template kjuulh bust_docker_template.yaml
add_template kjuulh bust_gobin_template.yaml
add_template kjuulh bust_gobin_default_template.yaml
add_template kjuulh bust_docker_template.yaml