2023-06-09 19:10:29 +00:00
|
|
|
job "lure-updater" {
|
|
|
|
region = "global"
|
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
|
|
|
|
2023-06-09 19:29:08 +00:00
|
|
|
group "lure-updater" {
|
2023-06-09 19:10:29 +00:00
|
|
|
network {
|
|
|
|
port "webhook" {
|
|
|
|
to = 8080
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-09 19:29:08 +00:00
|
|
|
volume "lure-updater-data" {
|
2023-06-10 03:38:43 +00:00
|
|
|
type = "host"
|
|
|
|
source = "lure-updater-data"
|
2023-06-09 19:29:08 +00:00
|
|
|
read_only = false
|
|
|
|
}
|
|
|
|
|
2023-06-09 19:10:29 +00:00
|
|
|
task "lure-updater" {
|
|
|
|
driver = "docker"
|
|
|
|
|
2023-06-09 19:29:08 +00:00
|
|
|
volume_mount {
|
2023-06-10 03:38:43 +00:00
|
|
|
volume = "lure-updater-data"
|
2023-06-09 19:29:08 +00:00
|
|
|
destination = "/etc/lure-updater"
|
2023-06-10 03:38:43 +00:00
|
|
|
read_only = false
|
2023-06-09 19:29:08 +00:00
|
|
|
}
|
|
|
|
|
2023-06-09 19:10:29 +00:00
|
|
|
env {
|
2023-06-10 03:38:43 +00:00
|
|
|
GIT_REPO_DIR = "/etc/lure-updater/repo"
|
2023-10-07 02:17:08 +00:00
|
|
|
GIT_REPO_URL = "https://github.com/lure-sh/lure-repo.git"
|
2023-06-10 03:38:43 +00:00
|
|
|
GIT_CREDENTIALS_USERNAME = "lure-repo-bot"
|
|
|
|
GIT_CREDENTIALS_PASSWORD = "${GITHUB_PASSWORD}"
|
|
|
|
GIT_COMMIT_NAME = "lure-repo-bot"
|
|
|
|
GIT_COMMIT_EMAIL = "lure@elara.ws"
|
|
|
|
WEBHOOK_PASSWORD_HASH = "${PASSWORD_HASH}"
|
|
|
|
|
2023-06-09 19:10:29 +00:00
|
|
|
// Hack to force Nomad to re-deploy the service
|
|
|
|
// instead of ignoring it
|
|
|
|
COMMIT_SHA = "${DRONE_COMMIT_SHA}"
|
|
|
|
}
|
|
|
|
|
|
|
|
config {
|
|
|
|
image = "alpine:latest"
|
|
|
|
command = "/opt/lure-updater/lure-updater"
|
2023-06-14 05:05:07 +00:00
|
|
|
args = ["-DE"]
|
2023-06-10 03:38:43 +00:00
|
|
|
ports = ["webhook"]
|
|
|
|
volumes = ["local/lure-updater/:/opt/lure-updater:ro"]
|
2023-06-09 19:29:08 +00:00
|
|
|
}
|
2023-06-09 19:10:29 +00:00
|
|
|
|
|
|
|
artifact {
|
2023-06-09 19:29:08 +00:00
|
|
|
source = "https://api.minio.elara.ws/lure-updater/lure-updater-$${attr.cpu.arch}.tar.gz"
|
|
|
|
destination = "local/lure-updater"
|
2023-06-09 19:10:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
2023-06-21 21:24:32 +00:00
|
|
|
name = "lure-updater"
|
2023-06-09 19:10:29 +00:00
|
|
|
port = "webhook"
|
|
|
|
|
|
|
|
tags = [
|
|
|
|
"traefik.enable=true",
|
2023-10-07 18:50:57 +00:00
|
|
|
"traefik.http.routers.lure-updater.rule=Host(`updater.lure.sh`)",
|
2023-06-09 19:29:08 +00:00
|
|
|
"traefik.http.routers.lure-updater.tls.certResolver=letsencrypt",
|
2023-06-09 19:10:29 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|