-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaypoint.hcl
102 lines (90 loc) · 2.14 KB
/
waypoint.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
project = "prosanteconnect/${workspace.name}/pscload-v2"
# Labels can be specified for organizational purposes.
labels = {
"domaine" = "psc"
}
runner {
enabled = true
profile = "secpsc-${workspace.name}"
data_source "git" {
url = "https://github.com/ansforge/psc-rass-loader.git"
ref = "${workspace.name}"
}
poll {
enabled = false
}
}
# An application to deploy.
app "prosanteconnect/pscload-v2" {
# Build specifies how an application should be deployed. In this case,
# we'll build using a Dockerfile and keeping it in a local registry.
build {
use "docker" {
disable_entrypoint = true
build_args = {"PROSANTECONNECT_PACKAGE_GITHUB_TOKEN"="${var.github_token}"}
}
# Uncomment below to use a remote docker registry to push your built images.
registry {
use "docker" {
image = "${var.registry_username}/pscload-v2"
tag = gitrefpretty()
username = var.registry_username
password = var.registry_password
local = var.is_local_registry
}
}
}
# Deploy to Nomad
deploy {
use "nomad-jobspec" {
jobspec = templatefile("${path.app}/pscload-v2.nomad.tpl", {
datacenter = var.datacenter
nomad_namespace = var.nomad_namespace
log_level = var.log_level
registry_path = var.registry_username
disable_messages = var.disable_messages
})
}
}
}
variable "datacenter" {
type = string
default = ""
env = ["NOMAD_DATACENTER"]
}
variable "nomad_namespace" {
type = string
default = ""
env = ["NOMAD_NAMESPACE"]
}
variable "is_local_registry" {
type = bool
default = true
env = ["LOCAL_REGISTRY"]
}
variable "registry_username" {
type = string
default = ""
env = ["REGISTRY_USERNAME"]
sensitive = true
}
variable "registry_password" {
type = string
default = ""
env = ["REGISTRY_PASSWORD"]
sensitive = true
}
variable "log_level" {
type = string
default = "INFO"
}
variable "disable_messages" {
type = string
default = "false"
}
variable "github_token" {
type = string
default = ""
env = ["PROSANTECONNECT_PACKAGE_GITHUB_TOKEN"]
sensitive = true
}