Add

Learn how to create a secret.

Command

$ vela add secret <parameters...> <arguments...>

Parameters

The following parameters are used to configure the command:

NameDescriptionEnvironment Variables
orgname of organization for the secretVELA_ORG, SECRET_ORG
reponame of repository for the secretVELA_REPO, SECRET_REPO
secret.enginename of engine that stores the secretVELA_ENGINE. SECRET_ENGINE
secret.typename of type of secret being storedVELA_TYPE, SECRET_TYPE
teamname of team for the secretVELA_TEAM, SECRET_TEAM
namename of the secretVELA_NAME, SECRET_NAME
valuevalue of the secretVELA_VALUE, SECRET_VALUE
imagebuild image(s) that can access the secretVELA_IMAGES, SECRET_IMAGES
eventbuild event(s) that can access the secretVELA_EVENTS, SECRET_EVENTS
commandsallows a step with commands to access the secretVELA_COMMANDS, SECRET_COMMANDS
substitutionallows substitution of secret using ${KEY} formatVELA_SUBSTITUTION, SECRET_SUBSTITUTION
filename of file used to add the secret(s)VELA_FILE, SECRET_FILE
outputformat the output for the secretVELA_OUTPUT, SECRET_OUTPUT

Permissions

COMING SOON!

Sample

Request

$ pwd
~/github/octocat
$ vela add secret --secret.engine native --secret.type repo --name foo --value bar

Targeted Request

$ vela add secret --secret.engine native --secret.type repo --org github --repo octocat --name foo --value bar

Response

secret "foo" was added

Advanced

Input From File

Vela supports creating a single-line or multi-line secret from a file using the @ symbol.

# Syntax
vela add secret --secret.engine native --secret.type repo --org github --repo octocat --name foo --value @/path/to/file

# Example
vela add secret --secret.engine native --secret.type repo --org github --repo octocat --name foo --value @$HOME/tmp/secret.txt

Secrets From File

Vela supports creating multiple secrets from a file using the filename parameter.

vela add secret -f secret.yml
Single YAML document
---
metadata:
  version: v1
  engine: native
secrets:
  - org: octocat
    repo: github
    name: foo
    value: bar
    type: repo
    images:
      - golang:latest
    events:
      - push
      - pull_request
  - org: github
    team: octokitties
    name: foo1
    value: "@/path/to/file/bar1"
    type: shared
    images:
      - golang:latest
    events:
      - push
      - pull_request
Multiple YAML document
---
metadata:
  version: v1
  engine: native
secrets:
  - org: github
    repo: octocat
    name: foo
    value: bar
    type: repo
    images:
      - golang:latest
    events:
      - push
      - pull_request

---
metadata:
  version: v1
  engine: vault
secrets:
  - org: github
    team: octokitties
    name: foo1
    value: "@/path/to/file/bar1"
    type: shared
    images:
      - golang:latest
    events:
      - push
      - pull_request