Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document "env" step #758

Closed
lkysow opened this issue Aug 26, 2019 · 7 comments · Fixed by #890
Closed

Document "env" step #758

lkysow opened this issue Aug 26, 2019 · 7 comments · Fixed by #890
Labels
docs Documentation

Comments

@lkysow
Copy link
Member

lkysow commented Aug 26, 2019

#751 added a new custom step type:

workflows:
  default:
    plan:
      steps:
     # Set TEST=123
      - env:
           name: TEST
           value: 123
      - run: echo $TEST # Will echo 123

     # Set TEST=123 by running the command.
      - env:
           name: TEST
           command: echo 123
      - run: echo $TEST # Will echo 123

This needs to be documented.

@lkysow lkysow added the docs Documentation label Aug 26, 2019
@lkysow
Copy link
Member Author

lkysow commented Aug 26, 2019

@anasinnyk are you able to find your commit where you had the documentation?

@k-k
Copy link

k-k commented Aug 26, 2019

@lkysow Should probably update the release notes for v0.9.0 - to show the step is env not var.

@lkysow
Copy link
Member Author

lkysow commented Aug 26, 2019

@kmfk 🤦‍♂ thanks!

@lkysow lkysow changed the title Document "var" step Document "env" step Aug 26, 2019
@smiller171
Copy link

Does variable expansion (especially command expansion) work in the env step?

@lkysow
Copy link
Member Author

lkysow commented Aug 29, 2019

Given

- env:
    name: NAME
    command: "command string"

We run:

sh -c "command string"

So command expansion should work.

lkysow added a commit that referenced this issue Jan 6, 2020
@cdenneen
Copy link

@lkysow not sure what I'm doing wrong here or if this needs updated documentation but in my repo I have the following atlantis.yaml:

version: 3
workflows:
  default:
    plan:
      steps:
      - env:
          name: TF_VAR_aws_account_id
          value: "111111111111"
      - env:
          name: TF_VAR_gitlab_token
          command: 'echo "$ATLANTIS_GITLAB_TOKEN"'
      - env:
          name: TF_VAR_aws_region
          value: "us-east-1"
      - env:
          name: TF_VAR_account_name
          value: "awsdev"

but when it runs Atlantis shows:

╷
│ Error: No value for required variable
│ 
│   on variables.tf line 27:
│   27: variable "account_name" {
│ 
│ The root module input variable "account_name" is not set, and has no
│ default value. Use a -var or -var-file command line argument to provide a
│ value for this variable.
╵
╷
│ Error: No value for required variable
│ 
│   on variables.tf line 30:
│   30: variable "aws_account_id" {
│ 
│ The root module input variable "aws_account_id" is not set, and has no
│ default value. Use a -var or -var-file command line argument to provide a
│ value for this variable.
╵
╷
│ Error: No value for required variable
│ 
│   on variables.tf line 38:
│   38: variable "gitlab_token" {
│ 
│ The root module input variable "gitlab_token" is not set, and has no
│ default value. Use a -var or -var-file command line argument to provide a
│ value for this variable.
╵
╷
│ Error: No value for required variable
│ 
│   on variables.tf line 58:
│   58: variable "aws_region" {
│ 
│ The root module input variable "aws_region" is not set, and has no default
│ value. Use a -var or -var-file command line argument to provide a value for
│ this variable.

@jamengual
Copy link
Contributor

please create a new issue if is necessary, Luke does not work on the project anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants