Skip to content

Commit

Permalink
rebase me up
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Jul 28, 2024
1 parent 80a69a4 commit 8a10cf4
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions nomadtools-githubrunner.nomad.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
locals {
DIR = "${abspath(".")}"
}
variable "githubtoken" {
type = string
}
job "nomadtools-githubrunner" {
namespace = "services"
group "nomadtools-githubrunner" {
ephemeral_disk {
migrate = true
sticky = true
}

job "build" {
driver = "docker"
config {
image = "docker:cli"
args = ["sh", "-xc", "docker build -t nomad:${NOMAD_ALLOC_ID} --target app ."]
work_dir = "/mnt"
mount {
type = "bind"
source = "/var/run/docker.sock"
target = "/var/run/docker.sock"
}
mount {
type = "bind"
source = local.DIR
target = "/mnt"
}
}
lifecycle {
hook = "prestart"
}
}

job "nomadtools-githubrunner" {
driver = "docker"
config {
image = "nomad:${NOMAD_ALLOC_ID}"
args = [
"--config",
<<-EOF
---
nomad:
namespace: github
github:
token: ${var.token}
cachefile: ${NOMAD_ALLOC_DIR}/data/githubcache.json
repos:
- Kamilcuk
runner_inactivity_timeout: 1w
EOF
,
"run",
]
}
}

}
}

0 comments on commit 8a10cf4

Please sign in to comment.