add woodpecker files

Signed-off-by: natto1784 <natto@weirdnatto.in>
This commit is contained in:
2022-10-23 22:11:44 +05:30
parent f3e0b2271a
commit e2c95f5bfe
4 changed files with 186 additions and 8 deletions

View File

@@ -0,0 +1,57 @@
job "woodpecker-agent" {
region = "global"
datacenters = [ "nazrin" ]
type = "service"
group "svc" {
count = 1
network {
mode = "bridge"
}
vault {
policies = [ "woodpecker-agent" ]
}
service {
connect {
sidecar_service {
proxy {
upstreams {
destination_name = "woodpecker-grpc"
local_bind_port = 9000
}
}
}
}
}
task "woodpecker" {
driver = "docker"
config {
image = "woodpeckerci/woodpecker-agent:latest"
command = "agent"
volumes = [ "/var/run/docker.sock:/var/run/docker.sock"]
}
resources {
cpu = 2048
memory = 2048
}
template {
data = <<EOF
WOODPECKER_LOG_LEVEL=info
WOODPECKER_USERNAME=Marisa
WOODPECKER_AGENT_SECRET={{ with secret "kv/data/woodpecker/agent" }}{{ .Data.data.agent_secret }}{{ end }}
WOODPECKER_MAX_PROCS=2
WOODPECKER_SERVER={{ env "NOMAD_UPSTREAM_ADDR_woodpecker_grpc" }}
EOF
env = true
change_mode = "restart"
destination = "${NOMAD_SECRETS_DIR}/data.env"
}
}
}
}