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

Pass terraform plan output to apply #175

Closed
codezninja opened this issue Dec 17, 2019 · 3 comments · Fixed by #294
Closed

Pass terraform plan output to apply #175

codezninja opened this issue Dec 17, 2019 · 3 comments · Fixed by #294
Labels
enhancement New feature or request
Milestone

Comments

@codezninja
Copy link
Contributor

Current issue I know we've talked about is when running terraform plan output. The output file has relative paths to where it was ran. So if you ran apply on another node in jenkins and the paths where different. Things would break.

I'm wondering what happens when you set the environment variable TF_IN_AUTOMATION? Does it remove all those relative path issues?

@codezninja
Copy link
Contributor Author

@codezninja
Copy link
Contributor Author

NVM. looking more through this. found this statement Before running apply, obtain the archive created in the previous step and extract it at the same absolute path.

I wonder if there's a better way to solve this?

@kmanning kmanning added the enhancement New feature or request label Jan 15, 2020
@jantman
Copy link
Contributor

jantman commented Feb 14, 2020

I thought there was an open feature request on terraform to fix this, but apparently there isn't.

Extracting at the same absolute path is problematic in Jenkins, because (1) if you have multiple build nodes, you'd need to ensure that JENKINS_HOME is the same on all of them, and (2) if you're using GitHub Branch Source / Multibranch, I'm pretty sure the workspace paths are different for every build.

The only sure-fire way that I can think of to fix this is to run terraform inside a Docker container (i.e. with docker.image('image/name:tag').inside() { ... }, and mount the workspace in to some reproducible path like /app. But that's pretty ugly for multiple reasons, if you're not already doing it.

@kmanning kmanning added this to the v5.11 milestone Sep 1, 2020
@kmanning kmanning linked a pull request Sep 3, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants