Skip to content

docs: Pass -target arguments in a custom workflow #1167

Open
@dimisjim

Description

@dimisjim

Hey there.

I am trying to run a custom workflow which intends to have atlantis push the DEBUG log of the terraform process run to an external provider (by redirecting its outputto a file and in another step, to upload that log file to the desired source)

Current issue is that I can't find a way to both have terraform run via a plan: steps: run: way (which is needed in order to perform the output redireciton to that file) AND at the same time pass the target arguments given in the PR comment.

I have tried using the COMMENT_ARGS env var, but I haven't found a way so far to make it work consistently, regardless of the amount of target args given in the comment PR.

Is there any standard way of doing this? There doesn't seem to be a clearly described way to do this in https://www.runatlantis.io/docs/custom-workflows.html#reference

Thanks

EDIT:
Most of my attempts lead to stat: no such file or directory errors:

- run: terraform$ATLANTIS_TERRAFORM_VERSION plan -input=false -refresh -no-color -out \"$PLANFILE\" ${COMMENT_ARGS//'\'/"\\\\"}

exit status 1: running "terraform$ATLANTIS_TERRAFORM_VERSION plan -input=false -refresh -no-color -out \\\"$PLANFILE\\\" ${COMMENT_ARGS//'\\'/\"\\\\\\\\\"}" in "/home/atlantis/.atlantis/repos/1plusX/infrastructure/860/default/terraform": 
stat \\-\\t\\a\\r\\g\\e\\t\\=\\m\\o\\d\\u\\l\\e\\.\\b\\a\\s\\t\\i\\o\\n\\-\\m\\o\\n\\i\\t\\o\\r\\i\\n\\g\\-\\l\\a\\m\\b\\d\\a: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaledocsDocumentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions