Skip to content

Root_dir is not applied #105

Description

@etienne-napoleone

Hi!
I've been testing drone-terraform and can't get root_dir to work:

---
kind: pipeline
type: docker
name: terraform

steps:
- name: plan
  image: jmccann/drone-terraform:6
  plan: true
  root_dir: terraform
  volumes:
    - name: docker
      path: /var/run/docker.sock

volumes:
  - name: docker
    host:
      path: /var/run/docker.sock
➜ tree .
.
├── README.md
├── .drone.yml
└── terraform
    └── main.tf
➜ drone exec --trusted
[plan:0] time="2019-11-01T06:08:01Z" level=info msg="Drone Terraform Plugin Version" Revision=
[plan:1] $ terraform version
[plan:2] Terraform v0.12.11
[plan:3]
[plan:4] Your version of Terraform is out of date! The latest version
[plan:5] is 0.12.13. You can update by downloading from www.terraform.io/downloads.html
[plan:6] $ rm -rf .terraform
[plan:7] $ terraform init -input=false
[plan:8] Terraform initialized in an empty directory!
[plan:9]
[plan:10] The directory has no Terraform configuration files. You may begin working
[plan:11] with Terraform immediately by creating Terraform configuration files.
[plan:12] $ terraform get
[plan:13] $ terraform validate
[plan:14] Success! The configuration is valid.
[plan:15]
[plan:16] $ terraform plan -out=plan.tfout
[plan:17]
[plan:18] Error: No configuration files
[plan:19]
[plan:20] Plan requires configuration to be present. Planning without a configuration
[plan:21] would mark everything for destruction, which is normally not what is desired.
[plan:22] If you would like to destroy everything, run plan with the -destroy option.
[plan:23] Otherwise, create a Terraform configuration file (.tf file) and try again.
[plan:24]
[plan:25] time="2019-11-01T06:08:02Z" level=fatal msg="Failed to execute a command" error="exit status 1"
2019/11/01 15:08:03 plan : exit code 1

If I put the file in the root directory, it will be planned.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions