Skip to content

Commit

Permalink
Add a staging .hcl file
Browse files Browse the repository at this point in the history
Co-authored-by: Eliot Jordan <[email protected]>
  • Loading branch information
hackartisan and eliotjordan committed Jan 15, 2025
1 parent 85c92e9 commit 84eb6b6
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions config/deploy/staging.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
variable "branch_or_sha" {
type = string
default = "main"
}
job "abid-staging" {
region = "global"
datacenters = ["dc1"]
node_pool = "staging"
type = "service"
group "web" {
count = 2
network {
port "http" { to = 3000 }
}
service {
port = "http"
check {
type = "http"
port = "http"
path = "/health.json"
interval = "10s"
timeout = "1s"
}
}
task "webserver" {
driver = "podman"
config {
image = "ghcr.io/pulibrary/abid:${ var.branch_or_sha }"
ports = ["http"]
force_pull = true
}
resources {
cpu = 1000
memory = 500
}
template {
destination = "${NOMAD_SECRETS_DIR}/env.vars"
env = true
change_mode = "restart"
data = <<EOF
{{- with nomadVar "nomad/jobs/abid-staging" -}}
ABID_SECRET_KEY_BASE = '{{ .ABID_SECRET_KEY_BASE }}'
APP_DB = {{ .APP_DB }}
APP_DB_USERNAME = {{ .APP_DB_USERNAME }}
APP_DB_PASSWORD = {{ .APP_DB_PASSWORD }}
APP_DB_HOST = {{ .APP_DB_HOST }}
APPLICATION_HOST = 'abid-staging.princeton.edu'
APPLICATION_HOST_PROTOCOL = 'https'
APPLICATION_PORT = '443'
RAILS_ENV = 'staging'
HONEYBADGER_API_KEY = {{ .HONEYBADGER_API_KEY }}
ASPACE_USER = {{ .ASPACE_USER }}
ASPACE_PASSWORD = {{ .ASPACE_PASSWORD }}
ALMA_API_KEY = {{ .ALMA_API_KEY }}
RAILS_MASTER_KEY = {{ .RAILS_MASTER_KEY }}
{{- end -}}
EOF
}
}
}
}

0 comments on commit 84eb6b6

Please sign in to comment.