homelab/nomad-job/platform/drone-runner.nomad

49 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-11-27 14:25:26 +00:00
job "drone-runner" {
datacenters = ["homelab"]
priority = 50
type = "system"
meta {
forcedeploy = "0"
}
group "drone-runner"{
vault{
policies= ["droneci"]
}
task "drone-runner" {
driver = "docker"
config {
2024-03-17 17:58:24 +00:00
image = "docker.service.consul:5000/drone/drone-runner-docker:latest"
2022-11-27 14:25:26 +00:00
volumes = [
"/var/run/docker.sock:/var/run/docker.sock",
]
}
env {
}
template {
data = <<EOH
{{ with secret "secrets/data/nomad/droneci"}}
2023-11-05 18:08:17 +00:00
DRONE_RPC_HOST="drone.ducamps.eu"
2022-11-27 14:25:26 +00:00
DRONE_RPC_PROTO="https"
DRONE_RPC_SECRET= "{{ .Data.data.DRONE_RPC_SECRET}}"
DRONE_SECRET_PLUGIN_TOKEN={{ .Data.data.DRONE_VAULT_SECRET}}
{{ end }}
{{- range service "drone-vault" }}
DRONE_SECRET_PLUGIN_ENDPOINT=http://{{ .Address }}:{{ .Port }}
{{- end}}
EOH
destination = "local/drone-runner.env"
env = true
}
resources {
memory = 50
}
}
}
}