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

The input device is not a TTY #128

Closed
anthonycolon25 opened this issue Jul 19, 2019 · 4 comments
Closed

The input device is not a TTY #128

anthonycolon25 opened this issue Jul 19, 2019 · 4 comments

Comments

@anthonycolon25
Copy link

I am trying to integrate terraform-compliance into a Jenkins pipeline. I tried putting the following two command within a sh inside a stage but it kept complaining about having to escape the $:

function terraform-compliance { docker run --rm -v $(pwd):/target -i -t eerkunt/terraform-compliance "$@"; }
terraform-compliance -p /target/tc-test2/tf-template/plan.out.json -f /target/tc-test2/features

I then tried consolidating into just a call to docker as follows:

docker run --rm -v \$(pwd):/target -i -t eerkunt/terraform-compliance:1.0.24 "--no-ansi -p /target/tc-test2/tf-template/plan.out.json -f /target/tc-test2/features"

I get the following error:

docker run --rm -v /home/centos/workspace/terraform-abcsandbox-ptct-0.12-tf-us-east-1-app/tf-template:/target -i -t eerkunt/terraform-compliance:1.0.24 '--no-ansi -p /target/tc-test2/tf-template/plan.out.json -f /target/tc-test2/features'
the input device is not a TTY
  • Can you use the function call declaration within a sh in a Jenkins pipeline? If so, is there an example of the commands and what needs to be escaped?
  • If you can't use the function call in Jenkins, does the single consolidated command above look correct?
@anthonycolon25
Copy link
Author

anthonycolon25 commented Jul 19, 2019

It looks like I just had to remove the -i -t to get the consolidated command to get passed the "input device is not TTY" error.

Now I get the following:

+ docker run --rm -v /home/centos/workspace/terraform-abcsandbox-ptct-0.12-tf-us-east-1-app:/target eerkunt/terraform-compliance:1.0.24 '-p /target/tf-template/plan.out.json -f /target/features'
terraform-compliance v1.0.24 initiated

ERROR:  /target/tf-template/plan.out.json -f /target/features is not a file.

@anthonycolon25
Copy link
Author

anthonycolon25 commented Jul 19, 2019

This command seems to work:

docker run --rm -v \$(pwd):/target eerkunt/terraform-compliance:1.0.24 -p /target/tc-test2/tf-template/plan.out.json -f /target/tc-test2/features

The only problem is that in the Jenkins log the white text gets washed out. Very hard to see. if you use the following command all text is black and readable:

docker run --rm -v \$(pwd):/target eerkunt/terraform-compliance:1.0.24 --no-ansi -p /target/tc-test2/tf-template/plan.out.json -f /target/tc-test2/features

It would be great to have that white text more viewable, maybe use a slightly different shade
Unknown

@eerkunt
Copy link
Member

eerkunt commented Jul 21, 2019

Hi @anthonycolon25,

This is something that terraform-compliance can not control and defined within radish-bdd. Also for the [26m there, we created a ticket against radish-bdd #359.

I usually don't use any color coding within CI/CD pipelines by adding -no-ansi parameter to the terraform-compliance.

@eerkunt
Copy link
Member

eerkunt commented Jul 23, 2019

Closing the issue, please don't hesitate to re-open the issue if you have more questions.

@eerkunt eerkunt closed this as completed Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants