Vendored
+1
-2
@@ -32,8 +32,7 @@ pipeline {
|
||||
// The next step is to make a POST request to http://nomad.service.consul/v1/jobs with content-type: application/json and content should { "Job": <parsed job specification> }
|
||||
steps {
|
||||
script {
|
||||
sh 'curl -X POST -H "Content-Type: application/json" -d "{ \"JobHCL\": \"$(cat jobspec.hcl)\" }" http://nomad.service.consul/v1/jobs/parse > parsed_job.json'
|
||||
sh 'curl -X POST -H "Content-Type: application/json" -d "{ \"Job\": $(cat parsed_job.json) }" http://nomad.service.consul/v1/jobs'
|
||||
sh 'curl -X POST -H "Content-Type: application/json" -d @jobspec.json http://nomad.service.consul:4646/v1/jobs'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
job "homepage" {
|
||||
datacenters = ["dc1"]
|
||||
|
||||
group "web" {
|
||||
count = 1
|
||||
|
||||
network {
|
||||
port "http" {
|
||||
to = 3000
|
||||
}
|
||||
}
|
||||
|
||||
task "homepage" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "docker-registry.service.consul:4124/efstajas/homepage:latest"
|
||||
ports = ["http"]
|
||||
}
|
||||
|
||||
service {
|
||||
name = "homepage-new"
|
||||
port = "http"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.homepage-new.rule=Host(`new.jason-e.dev`) || Host(`jason-e.dev`)",
|
||||
"traefik.http.routers.homepage-new.tls=true",
|
||||
"traefik.http.routers.homepage-new.tls.certresolver=myresolver",
|
||||
]
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 200
|
||||
memory = 200
|
||||
}
|
||||
|
||||
constraint {
|
||||
attribute = "${attr.cpu.arch}"
|
||||
value = "arm64"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"Job": {
|
||||
"ID": "homepage-new",
|
||||
"Name": "homepage-new",
|
||||
"Datacenters": ["dc1"],
|
||||
"TaskGroups": [
|
||||
{
|
||||
"Name": "web",
|
||||
"Count": 1,
|
||||
"Tasks": [
|
||||
{
|
||||
"Name": "homepage",
|
||||
"Driver": "docker",
|
||||
"User": "",
|
||||
"Config": {
|
||||
"image": "docker-registry.service.consul:4124/efstajas/homepage:latest",
|
||||
"ports": ["http"]
|
||||
},
|
||||
"Constraints": [
|
||||
{
|
||||
"LTarget": "${attr.cpu.arch}",
|
||||
"RTarget": "amd64",
|
||||
"Operand": "="
|
||||
}
|
||||
],
|
||||
"Affinities": null,
|
||||
"Env": null,
|
||||
"Services": [
|
||||
{
|
||||
"Name": "homepage-new",
|
||||
"Tags": [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.homepage-new.rule=Host(`new.jason-e.dev`) || Host(`jason-e.dev`)",
|
||||
"traefik.http.routers.homepage-new.tls=true",
|
||||
"traefik.http.routers.homepage-new.tls.certresolver=myresolver"
|
||||
],
|
||||
"PortLabel": "http"
|
||||
}
|
||||
],
|
||||
"Resources": {
|
||||
"CPU": 200,
|
||||
"MemoryMB": 200
|
||||
}
|
||||
}
|
||||
],
|
||||
"Networks": [
|
||||
{
|
||||
"DynamicPorts": [
|
||||
{
|
||||
"Label": "http",
|
||||
"Value": 0,
|
||||
"To": 3000,
|
||||
"HostNetwork": "",
|
||||
"IgnoreCollision": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user