Compare commits

..

88 Commits

Author SHA1 Message Date
331e54efd7 feat: small fix
Some checks failed
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/tag Build encountered an error
2025-07-26 22:48:27 +02:00
cc540bcca0 Revert "feat: with global .cargo instead"
Some checks failed
continuous-integration/drone/push Build is failing
This reverts commit ddc1126bd8.
2023-07-28 21:06:28 +02:00
ddc1126bd8 feat: with global .cargo instead
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 21:05:58 +02:00
a0e1fe5f95 feat: without cli
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 21:03:55 +02:00
f3a4fcae62 feat: ignore .cargo files
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 21:01:42 +02:00
75cd3f9478 feat: exit early
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:49:29 +02:00
390fef106d feat: as regular https://
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:48:10 +02:00
467b94fb5a feat: as ssh instead
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:45:08 +02:00
57cf758a56 feat: without cli
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:43:07 +02:00
97beda7482 feat: credentials as toml
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:41:59 +02:00
97433e5a7a feat: with credentials
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:41:43 +02:00
7e1f53b5b0 feat: use internal instead
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:39:33 +02:00
d44f678f2c feat: with actual url
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:38:45 +02:00
25a77d941f feat: remove duplicate
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:37:54 +02:00
34834e8c9b feat: as one
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:37:16 +02:00
0732890cb3 feat: with git token
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:35:43 +02:00
a4d2016752 feat: don't break lines
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:34:57 +02:00
59cf673c80 feat: with local .cargo
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:33:27 +02:00
e1fafc8063 feat: with local config
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:30:26 +02:00
8ec42c53a2 feat: with registry gitea
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:28:46 +02:00
c8e677c1e7 feat: with stuff
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:27:15 +02:00
7e085d15f2 feat: with actual command
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:26:43 +02:00
a63da99d5d feat: with main .cargo
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:01:12 +02:00
2a983b9cdc feat: with print registry
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 20:00:13 +02:00
e563bbfd0d feat: with base rust project
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:53:04 +02:00
4ff3acb1d3 fix: typo
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:40:21 +02:00
ed7e71e1c8 feat: with git token instead
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:37:56 +02:00
55e125c3a4 feat: with git token
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:35:31 +02:00
6e8ada5f5f feat: with version
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:35:19 +02:00
09c5fd8870 fix: typo
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:30:21 +02:00
23f0be8b22 feat: with update template
Some checks failed
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-28 19:29:41 +02:00
7e1a56c38c chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690561756917
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 16:47:14 +00:00
590a27d1ba chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690557914385
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 15:42:47 +00:00
470fc1a23f chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690555439818
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 15:01:34 +00:00
41c035ea2a chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690551893775
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 14:22:21 +00:00
22f710549d chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690548237217
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 13:01:00 +00:00
7e52c75e8d chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690545825295
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 12:22:05 +00:00
b33a3c50e8 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690543433935
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 11:40:58 +00:00
98d6388409 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690541018395
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 11:00:44 +00:00
d3dac68402 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690538410912
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 10:21:53 +00:00
a09d5d6841 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690534517371
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 09:14:56 +00:00
068e1ec8e0 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690531873416
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 08:29:40 +00:00
734480962e chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690527683365
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 07:20:22 +00:00
8c65532aa7 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690523494917
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 06:11:04 +00:00
0177540fc2 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690519231059
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 05:00:02 +00:00
4c1a75ce23 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690515100977
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 03:51:12 +00:00
8012a1db92 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690510955085
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 02:42:25 +00:00
5785061ba9 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690506770821
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 01:33:19 +00:00
1205ee63f3 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690504085966
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-28 00:47:01 +00:00
e2a478d1d8 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690497040556
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 22:50:55 +00:00
707b10658a chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 21:43:16 +00:00
a1519ace60 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690487640775
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 20:22:23 +00:00
88da202a00 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690483748847
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 19:07:31 +00:00
639ce47541 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690481152981
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 18:25:49 +00:00
551b310670 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690478732357
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 17:42:42 +00:00
64b3e32eb4 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690476237673
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 17:01:19 +00:00
e6ffb1a0c5 chore(deps): update docker.io/kasperhermansen/shuttle-drone docker tag to v1690472586475
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 16:21:43 +00:00
63de141cea chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-27 14:59:27 +00:00
b0b73434f0 feat: without my own shuttle
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-27 16:41:20 +02:00
14539d2517 feat: with inject
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-27 16:38:00 +02:00
2e43e6ce07 Merge pull request 'Configure Renovate' (#1) from renovate/configure into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: https://git.front.kjuulh.io/kjuulh/shuttle-drone-templates/pulls/1
2023-07-27 14:20:53 +00:00
62484dc804 Add renovate.json
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2023-07-27 14:20:25 +00:00
25092f613a feat: add extra template
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-07-27 16:19:24 +02:00
dd4e6f6fcc feat: add nightly option
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 00:38:25 +02:00
0e914322f4 feat: update with proper rust
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 00:22:04 +02:00
9f6acb0f13 chore: update main template
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-05 23:46:43 +02:00
2d3c1a898a feat: update to shuttle tag instead of branch
Some checks failed
continuous-integration/drone/push Build is failing
2023-05-05 23:41:55 +02:00
9613ec57a4 feat: update to shuttle 0.17.2
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2023-05-05 23:09:58 +02:00
eaf13c82ef feat: remove docker_host
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:38:50 +02:00
a7e7d082b4 feat: fix template
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:36:49 +02:00
508c1e2025 feat: fix sh pipeline not running to completion
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:30:48 +02:00
9cd7004f10 always green
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:24:15 +02:00
ed5d4674d7 trying with stdout instead
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:21:22 +02:00
fccc6f2433 feat: fix upload templates
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:17:01 +02:00
797de688d7 feat: add ci
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:14:38 +02:00
f46847a523 feat: with updated image
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-08 12:11:12 +02:00
7d4f4cc700 feat: with base64 decode
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-07 21:52:59 +02:00
8e63b8ca02 feat: with proper permissions
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 21:52:15 +02:00
488955aaa5 feat: with key
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 21:51:10 +02:00
580653f3de feat: cleanup 2023-04-07 21:43:33 +02:00
5adf004721 feat: without docker_host
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-07 21:43:06 +02:00
3be4128bd8 feat: without docker_host
Some checks failed
continuous-integration/drone/push Build was killed
2023-04-07 21:42:38 +02:00
ab8bfbdbe8 feat: remove docker.io
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 21:41:46 +02:00
b2d174ae75 feat: with environment
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
2023-04-07 21:06:37 +02:00
b04473daaf feat: with actual didn
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 21:04:20 +02:00
14ea48b0e8 feat: update drone
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 21:00:57 +02:00
e23230ba48 without o
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 20:58:01 +02:00
3124ddb6d6 feat: with pipefail
Some checks failed
continuous-integration/drone/push Build is failing
2023-04-07 20:57:41 +02:00
12 changed files with 330 additions and 28 deletions

View File

@@ -2,23 +2,48 @@ type: docker
kind: pipeline kind: pipeline
name: "shuttle-drone-templates" name: "shuttle-drone-templates"
steps: steps:
- name: "build" - name: "wait for dind"
image: docker.io/kasperhermansen/shuttle-drone:1680893418457 image: docker:dind
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
environment: environment:
#DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DOCKER_PASSWORD: DOCKER_PASSWORD:
from_secret: docker_password from_secret: docker_password
DOCKER_USERNAME: DOCKER_USERNAME:
from_secret: docker_username from_secret: docker_username
DOCKER_HOST: docker.io
commands: commands:
- set -eou pipefail - ls /var/run
- set -eu
- sleep 10 - sleep 10
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME"
- name: "build"
image: docker.io/kasperhermansen/shuttle-drone:1690561756917
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_BUILDKIT: 1
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
SSH_KEY:
from_secret: gitea_id_ed25519
DRONE_TOKEN:
from_secret: drone_token
commands:
- exit 0
- set -eu
- eval `ssh-agent`
- mkdir -p ~/.ssh
- echo "$SSH_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod -R 600 ~/.ssh
- ssh-add
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io - echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- shuttle run build - shuttle run build
- shuttle run ci
services: services:
- name: docker - name: docker
image: docker:dind image: docker:dind
@@ -29,3 +54,36 @@ services:
volumes: volumes:
- name: dockersock - name: dockersock
temp: {} temp: {}
---
type: docker
kind: pipeline
name: "release-please"
steps:
- name: release
image: marcoieni/release-plz:0.3.16
commands:
- mkdir -p .cargo
- |
cat <<EOF >> .cargo/config.toml
[registry]
default = "gitea"
[registries.gitea]
index = "https://git.kjuulh.io/kjuulh/_cargo-index.git"
#[net]
#git-fetch-with-cli = true
EOF
- |
cat <<EOF >> .cargo/credentials.toml
[registries.gitea]
token = "Bearer $GIT_TOKEN"
EOF
- release-plz release-pr --git-token="$GIT_TOKEN" --backend gitea --registry gitea
environment:
GIT_TOKEN:
from_secret: gitea_token
when:
branch:
- master
- main

8
.gitignore vendored
View File

@@ -1 +1,9 @@
.shuttle/ .shuttle/
.env
# Added by cargo
/target
.cargo/config.toml
.cargo/credentials.toml

8
Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "shuttle-drone-templates"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@@ -35,10 +35,10 @@ func Build(ctx context.Context) error {
ctx = context.Background() ctx = context.Background()
shuttleGit := client. shuttleGit := client.
Git("git@github.com:kjuulh/shuttle.git", dagger.GitOpts{ Git("git@github.com:lunarway/shuttle.git", dagger.GitOpts{
KeepGitDir: true, KeepGitDir: true,
}). }).
Branch("shuttletask"). Tag("v0.17.2").
Tree(dagger.GitRefTreeOpts{ Tree(dagger.GitRefTreeOpts{
SSHAuthSocket: client.Host().UnixSocket(os.Getenv("SSH_AUTH_SOCK")), SSHAuthSocket: client.Host().UnixSocket(os.Getenv("SSH_AUTH_SOCK")),
}) })
@@ -70,14 +70,36 @@ func Build(ctx context.Context) error {
Platform: platform, Platform: platform,
}). }).
From("docker:cli"). From("docker:cli").
Directory("/usr/local/bin"). File("/usr/local/bin/docker")
File("docker")
image := client. image := client.
Container(dagger.ContainerOpts{ Container(dagger.ContainerOpts{
Platform: platform, Platform: platform,
}). }).
From("golang:1.20.3"). From("golang:1.20.3").
WithExec([]string{
"apt", "update",
}).
WithExec([]string{
"apt", "install", "-y", "curl", "build-essential",
}).
WithEnvVariable("RUSTUP_HOME", "/usr/local/rustup").
WithEnvVariable("CARGO_HOME", "/usr/local/cargo").
WithExec([]string{
"bash", "-c", "curl https://sh.rustup.rs -sSf | bash -s -- -y",
})
path, err := image.EnvVariable(ctx, "PATH")
if err != nil {
return err
}
image = image.
WithEnvVariable(
"PATH", fmt.Sprintf("/usr/local/cargo/bin:%s", path),
).
WithExec([]string{"rustup", "toolchain", "install", "nightly"}).
WithExec([]string{"rustup", "default", "nightly"}).
WithWorkdir("/app"). WithWorkdir("/app").
WithFile("/usr/local/bin/shuttle", shuttle). WithFile("/usr/local/bin/shuttle", shuttle).
WithExec([]string{"shuttle", "version"}) WithExec([]string{"shuttle", "version"})
@@ -86,7 +108,12 @@ func Build(ctx context.Context) error {
return err return err
} }
image = image.WithFile("/usr/local/bin/docker", docker) if _, err := image.WithExec([]string{"cargo", "--version"}).ExitCode(ctx); err != nil {
log.Printf("%v", err)
return err
}
image = image.WithFile("/usr/bin/docker", docker)
if _, err := image.ExitCode(ctx); err != nil { if _, err := image.ExitCode(ctx); err != nil {
log.Printf("%v", err) log.Printf("%v", err)
return err return err
@@ -114,7 +141,6 @@ func Build(ctx context.Context) error {
dagger.ContainerPublishOpts{ dagger.ContainerPublishOpts{
PlatformVariants: containers, PlatformVariants: containers,
}) })
if err != nil { if err != nil {
log.Printf("%v", err) log.Printf("%v", err)
return err return err

91
actions/ci.go Normal file
View File

@@ -0,0 +1,91 @@
package main
import (
"context"
"fmt"
"log"
"os"
"path"
"dagger.io/dagger"
"github.com/joho/godotenv"
"golang.org/x/sync/errgroup"
)
func Ci(ctx context.Context) error {
_ = godotenv.Load()
client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout))
if err != nil {
return err
}
defer client.Close()
drone := client.
Container(dagger.ContainerOpts{Platform: "linux/amd64"}).
From("debian").
WithExec([]string{
"apt", "update",
}).
WithExec([]string{
"apt", "install", "-y", "wget", "tar",
}).
WithExec([]string{
"wget", "https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz",
}).
WithExec([]string{
"tar", "-xvf", "drone_linux_amd64.tar.gz",
}).
WithExec([]string{
"mv", "drone", "/usr/local/bin",
}).
WithExec([]string{
"drone", "--version",
})
_, err = drone.ExitCode(ctx)
if err != nil {
return err
}
templates := client.Host().Directory("templates")
droneTemplates := drone.
WithEnvVariable("DRONE_SERVER", "https://ci.i.kjuulh.io").
WithEnvVariable("DRONE_TOKEN", os.Getenv("DRONE_TOKEN")).
WithExec([]string{"drone", "info"}).
WithMountedDirectory("/mnt/templates", templates).
WithWorkdir("/mnt/templates")
entries, err := templates.Entries(ctx)
if err != nil {
return err
}
egrp, _ := errgroup.WithContext(ctx)
for _, entry := range entries {
entry := entry
egrp.Go(func() error {
name := path.Base(entry)
namespace := "kjuulh"
log.Printf("running for: %s", entry)
_, err := droneTemplates.
WithExec([]string{
"sh", "-c", fmt.Sprintf("drone template add --namespace %s --name %s --data @%s || true", namespace, name, name),
}).
WithExec([]string{
"drone", "template", "update", "--namespace", namespace, "--name", name, "--data", fmt.Sprintf("@%s", name),
}).
ExitCode(ctx)
return err
})
}
if err := egrp.Wait(); err != nil {
return err
}
return nil
}

View File

@@ -1,32 +1,31 @@
module shuttletask module actions
go 1.20 go 1.20
replace github.com/lunarway/shuttle => github.com/kjuulh/shuttle v0.0.0-20230407180512-4877329375cb
require ( require (
dagger.io/dagger v0.6.0 dagger.io/dagger v0.6.0
github.com/containerd/containerd v1.7.0 github.com/containerd/containerd v1.7.3
github.com/stretchr/testify v1.8.2 github.com/joho/godotenv v1.5.1
golang.org/x/sync v0.1.0 github.com/stretchr/testify v1.8.4
golang.org/x/sync v0.3.0
) )
require ( require (
github.com/Khan/genqlient v0.5.0 // indirect github.com/Khan/genqlient v0.5.0 // indirect
github.com/adrg/xdg v0.4.0 // indirect github.com/adrg/xdg v0.4.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.3 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect github.com/iancoleman/strcase v0.2.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.1 // indirect github.com/vektah/gqlparser/v2 v2.5.1 // indirect
golang.org/x/mod v0.7.0 // indirect golang.org/x/mod v0.9.0 // indirect
golang.org/x/sys v0.6.0 // indirect golang.org/x/sys v0.7.0 // indirect
golang.org/x/tools v0.5.0 // indirect golang.org/x/tools v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/grpc v1.53.0 // indirect google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.29.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

View File

@@ -18,6 +18,10 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdK
github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0=
github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg= github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg=
github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc= github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc=
github.com/containerd/containerd v1.7.2 h1:UF2gdONnxO8I6byZXDi5sXWiWvlW3D/sci7dTQimEJo=
github.com/containerd/containerd v1.7.2/go.mod h1:afcz74+K10M/+cjGHIVQrCt3RAQhUSCAjJ9iMYhhkuI=
github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o=
github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -27,12 +31,16 @@ github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0=
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
@@ -70,6 +78,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= github.com/vektah/gqlparser/v2 v2.4.5/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
@@ -86,6 +96,8 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs=
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -97,6 +109,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -111,6 +125,8 @@ golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -124,6 +140,8 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=
golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4=
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -136,6 +154,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM=
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

3
src/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View File

@@ -0,0 +1,57 @@
kind: pipeline
name: "drone-template"
type: docker
steps:
- name: load_secret
image: debian:buster-slim
volumes:
- name: ssh
path: /root/.ssh/
environment:
SSH_KEY:
from_secret: gitea_id_ed25519
commands:
- mkdir -p $HOME/.ssh/
- echo "$SSH_KEY" | base64 -d > $HOME/.ssh/id_ed25519
- name: build
image: kasperhermansen/cuddle:b58597e25d
volumes:
- name: ssh
path: /root/.ssh/
- name: dockersock
path: /var/run
commands:
- git remote set-url origin $DRONE_GIT_SSH_URL
- eval `ssh-agent`
- chmod -R 600 ~/.ssh
- ssh-add
- cuddle x ci
environment:
DOCKER_BUILDKIT: 1
CUDDLE_SECRETS_PROVIDER: 1password
CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci"
CUDDLE_SSH_AGENT: "true"
CUDDLE_ONE_PASSWORD_INJECT: "{{`DOCKER_USERNAME={{ op://application/docker_hub_credentials/username }},DOCKER_PASSWORD={{ op://application/docker_hub_credentials/password }}`}}"
SSH_KEY:
from_secret: gitea_id_ed25519
OP_SERVICE_ACCOUNT_TOKEN:
from_secret: op_service_account_token
depends_on:
- "load_secret"
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: ssh
temp: {}
- name: dockersock
temp: {}

View File

@@ -1,18 +1,47 @@
type: docker type: docker
kind: pipeline kind: pipeline
name: "drone-dagger-test" name: "shuttle-drone-templates"
steps: steps:
- name: "build" - name: "wait for dind"
image: docker.io/kjuulh/shuttle-drone image: docker:dind
volumes: volumes:
- name: dockersock - name: dockersock
path: /var/run path: /var/run
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
commands: commands:
- sleep 5 - ls /var/run
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username="$${DOCKER_USERNAME}" "$${DOCKER_HOST}" - set -eu
- shuttle run build - sleep 10
- echo "$${DOCKER_PASSWORD}" | docker login --password-stdin --username="$${DOCKER_USERNAME}"
- name: "build"
image: docker.io/kasperhermansen/shuttle-drone:1683325750924
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_BUILDKIT: 1
DOCKER_PASSWORD:
from_secret: docker_password
DOCKER_USERNAME:
from_secret: docker_username
DRONE_TOKEN:
from_secret: drone_token
SSH_KEY:
from_secret: gitea_id_ed25519
commands:
- set -eu
- eval `ssh-agent`
- mkdir -p ~/.ssh
- echo "$SSH_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod -R 600 ~/.ssh
- ssh-add
- echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io
- shuttle run ci
services: services:
- name: docker - name: docker
image: docker:dind image: docker:dind