github.com/hernad/nomad@v1.6.112/ui/app/utils/default_jobs/variables.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  /* eslint-disable */
     7  export default `// Use Nomad Variables to modify this job's output:
     8  // run "nomad var put nomad/jobs/variables-example name=YOUR_NAME" to get started
     9  
    10  job "variables-example" {
    11    // Specifies the datacenter where this job should be run
    12    // This can be omitted and it will default to ["*"]
    13    datacenters = ["*"]
    14  
    15    group "web" {
    16  
    17      network {
    18        // Task group will have an isolated network namespace with
    19        // an interface that is bridged with the host
    20        port "www" {
    21          to = 8001
    22        }
    23      }
    24  
    25      service {
    26        provider = "nomad"
    27        port     = "www"
    28      }
    29  
    30      task "http" {
    31  
    32        driver = "docker"
    33  
    34        config {
    35          image   = "busybox:1"
    36          command = "httpd"
    37          args    = ["-v", "-f", "-p", "8001", "-h", "/local"]
    38          ports   = ["www"]
    39        }
    40  
    41        // Create a template resource that will be used to render the html file
    42        // using the Nomad variable at "nomad/jobs/variables-example"
    43        template {
    44          data        = "<html>hello, {{ with nomadVar \\" nomad/jobs/variables-example \\" }}{{ .name }}{{ end }}</html>"
    45          destination = "local/index.html"
    46        }
    47  
    48        resources {
    49          cpu    = 128
    50          memory = 128
    51        }
    52  
    53      }
    54    }
    55  }`;