Skip to content
Browse files

Add documentation for using deployment-cli templating

  • Loading branch information...
TheUnnamedDude committed Jun 13, 2019
1 parent a6703c4 commit 84f1949927669b6117af2c09ac79d87c1ff5e417
Showing with 53 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +52 −1 content/deploy/
@@ -1 +1,2 @@
@@ -76,11 +76,62 @@ deployment-cli create \
--appid=1234 \
--key=/path/to/private-key.pem \
--resources=nais.yaml \

If for any reason you are unable to use _deployment-cli_, please read the section on [NAIS deploy with cURL](#nais-deploy-with-curl).

### Handling multiple deployments using deployment-cli built in templating
deployment-cli has built in templating using [Handlebars](, this makes it possible to create
multiple deployments using the same nais.yaml as a template and different configuration files for placeholders. By
default deployment-cli will also inject a few of the flags passed to it:

* ref: git reference. Specified by the --ref flag. Default: master
* cluster: which cluster the deploy is for. Specified by the --cluster/-c flag. Default: dev-fss
* team: the team this deployment is for. Specified by the --team/t flag.
* version: the version, this is strictly for templating and should be used to specify which version of the Docker file should be pulled. Specified using the --version flag

apiVersion: ""
kind: "Application"
name: {{application_name}}
namespace: default
team: {{team}}
image: "{{version}}"
port: 8080
min: 1
max: 4
cpuThresholdPercentage: 70
path: /is_alive
path: /is_alive
enabled: true
path: /prometheus
{{#each env}}
name: '{{@key}}'
value: '{{this}}'

Here the version number and team name will be injected by the flags passed to deployment-cli, application_name will come
from the configuration file. For each pair in the env tag it will inject the key as the env var name and value as is.
"application_name": "example_app",
"env": {
"MY_ENV_VAR": "cluster specific value",
"SECOND_ENV_VAR": "another one"

### Deployment request spec

| Key | Description | Version added |

0 comments on commit 84f1949

Please sign in to comment.
You can’t perform that action at this time.