open-nomad/website/source/docs/commands/job/init.html.md

45 lines
1.1 KiB
Markdown
Raw Normal View History

---
layout: "docs"
2018-03-22 17:56:06 +00:00
page_title: "Commands: job init"
sidebar_current: "docs-commands-job-init"
description: >
2018-03-22 17:56:06 +00:00
The job init command is used to generate a skeleton jobspec template.
---
2018-03-22 17:56:06 +00:00
# Command: job init
2018-03-22 18:09:26 +00:00
**Alias: `nomad init`**
2018-03-22 17:56:06 +00:00
The `job init` command creates an example [job specification][jobspec] in the
current directory that demonstrates some common configurations for tasks, task
groups, runtime constraints, and resource allocation.
## Usage
```plaintext
nomad job init [options] [filename]
```
You may optionally supply a filename for the example job to be written to. The
default filename for the generated file is "example.nomad".
Please refer to the [jobspec] and [drivers] pages to learn how to customize the
template.
2018-05-10 17:15:57 +00:00
## Init Options
- `-short`: If set, a minimal jobspec without comments is emitted.
- `-connect`: If set, the jobspec includes Consul Connect integration.
2018-05-10 17:15:57 +00:00
## Examples
Generate an example job file:
```shell
2018-03-22 17:56:06 +00:00
$ nomad job init
Example job file written to example.nomad
```
[jobspec]: /docs/job-specification/index.html "Nomad Job Specification"
[drivers]: /docs/drivers/index.html "Nomad Task Drivers documentation"