infrastructure/jobs/damienradtkecom.nomad -rw-r--r-- 1.4 KiB View raw
                                                                                
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
job "damienradtkecom" {
	region = "us"

	datacenters = ["us-central"]
	type = "service"

	group "server" {
		count = 2

		update {
			max_parallel = 1
		}

		task "server" {
			driver = "exec"
			config {
				# Hugo needs to run from the blog directory.
				# For now, this needs to be run via the shell.
				# See https://github.com/hashicorp/nomad/issues/2224
				command = "/bin/sh"
				args = [
					"-c",
					"cd local/blog && exec ../hugo server --baseURL=https://damienradtke.com/ --appendPort=false --watch=false --bind=0.0.0.0 --port=${NOMAD_PORT_http}",
				]
			}

			service {
				name = "${JOB}-${TASK}"
				port = "http"

				check {
				      type = "http"
				      protocol = "http"
				      port = "http"
				      interval = "10s"
				      timeout = "2s"
				      path = "/"
				}

				tags = ["urlprefix-damienradtke.com/"]
			}


			resources {
				cpu = 20  # MHz, the minimum value
				memory = 50  # MB
				network {
					port "http" {}
				}
			}

			artifact {
				source = "github.com/dradtke/blog"
				destination = "local/blog/"
				options {
					ref = "f0789dadf40e8c910e63be28af371b727d19413f"
				}
			}

			artifact {
				source = "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz"
				options {
					checksum = "sha256:b92c47a705ad372887454644f8bee76caa6234be13c073834827b58f73fb7adb"
				}
			}
		}
	}
}