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

vars_files can never be resolved to paths that work #79

Open
ShoryuKyzan opened this issue Sep 25, 2019 · 3 comments
Open

vars_files can never be resolved to paths that work #79

ShoryuKyzan opened this issue Sep 25, 2019 · 3 comments

Comments

@ShoryuKyzan
Copy link

Concourse 5.5.1
vars_files can never be resolved to paths that work.

... inside resources

  - name: development
    type: cf
    source:
      api: ...
      username: ...
      password: ...
      organization: ...
      space: ...

... inside tasks of the pipeline

      - put: development
        inputs: [put]
        params:
          manifest: put/manifest.yml
          vars_files:
            - put/<path to file>

Always fails with vars file file not found from the cf push command.
Incorrect Usage: The specified path 'put/sreteam.yml' does not exist.
And the file does exist, as checked by prior steps.

I have seen other versions of this with the magic directory /tmp/build/put/. Perhaps that is for older versions of concourse? I assume that is working for whoever wrote it but when I try it /tmp/build/put/ seems to be some kind of magic directory I can't carry over as an output from other tasks. The build working directory seems to be at /tmp/build/. When I copy things into /tmp/build/put the file is still not found. When you have just the filename in the vars_files input it will say /tmp/build/put/ is not found either.

It would seem that the working directory of the cf push command isn't /tmp/build/ in that container but something else. I note that os.Args[1] is concatenated to the manifest file path in main.go. Theres no problem finding the manifest file.

Workaround:

After reading some code I found that if I define path parameter, now vars file will be relative to that folder because it will chdir into it first before running the command.

@mamachanko
Copy link

We're having the same issue. @ShoryuKyzan can you explain your workaround in more detail?

@danworth
Copy link

Bit late but incase this helps someone, just put the path to the vars files relative to the path parameter like:

- put: cf
  params:
    path: first-input-directory
    manifest: first-input-directory/manfiest.yml
    vars_files:
      - ../second-input-directory/vars.yml

@sainath19
Copy link

sainath19 commented Mar 11, 2020

facing issue 'Expected to find variables' error even after defining vars_files with relative to path
And all the parameters defined in vars file matches with manifest's, no issue with parameters definition

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

4 participants