-
Notifications
You must be signed in to change notification settings - Fork 6
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
Repo path should be resolved relatively to current working directory #89
Comments
What do you mean with hard to use outside the docker image? It is hard to use now as a script, or will it be hard to use after you implement the feature? |
He meant hard to use as a script - If you call it from a relative path, it fails silently. The thing I was trying to do, was package release notes inside a docker image to serve it. I was running pac relatively, from the folder my repository was cloned into, which caused PAC to fail :) |
Okay, should fail silently of course. |
@Sharor I'm not entirely sure what path should be relative. Could you provide an example of a command that you would expect to work? |
@michaelmadsen I took the docker image, cloned a repository inside and ran pac.rb from inside the repo - this causes pac.rb to fail :) The idea was to be able to point to fx /pac.rb and /pac/templates and run it from /mypath/repository and produce release notes somewhere :) |
You're not supposed to do anything inside the docker container, so if that is the case we can close this issue. |
It matters for automation purposes in Concourse pipelines going forward. You can avoid Docker inside Docker if you're allowed to do things arbitrarily - and I do not see why you would lock down the container and disallow doing it inside the container? :) |
Okay, can you provide the series of commands and output the reproduces the issue? I would like to se them to consider the solution, as the image was not designed for this purpose and usually you don't exec into a container. |
Concourse does the following: Downloads and runs container, exec in with "get" resources mounted (think cloned repositories) to a tmp path (ie /build/tmp/buildcontext/somesha/myclonedrepo) which is randomized for every build (new sha) It then gives you full control of the container image, and allows you to execute commands from the build job (typically shell). The 'normal' way to use PAC would be to know where your repository is, but it then gets very messy unless I move the git repository out of my path to a 'known' location. My thought was to create release notes in the build context, by just running pac where I stood in each git repo and then output my release with the notes, so they are in the correct context as the repository/repositories pass along the pipeline :) It's not an unsolvable problem (I can just dump repos in a known location as said) - I just figured the silent bit was a problem either way 😉 |
Okay, think we need to groom this issue further. |
I now tried it, things works exactly as I would expect. I find some git repository I have. It contains a settingsfile for pac and one file README where some commits are done.
I can now start a pac container, it is latest version 2.1.1-9 (b29acba) by the way, and overwrite entrypoint to allow me to step into it using bash. I mount in my git repository above, into an "arbitrary" path so
I can now run pac. The pac command is on my PATH inside the container, so I can run it from anywhere:
I can also give it my settingsfile:
The settings file should obviously be in the repository itself where it belongs. The settings file above, contain among other things, the following relevant settings:
Those are references to the default supplied PAC templates, that are distributed with the PAC image on that path.
That setting tells PAC that the repository location, is in the same path as the settings file, which is pretty basic. So how would you use it differently? Can you give me the same set of commands? Or post your configuration files? Please notice you should never need to call pac.rb inside the container, just call By the way for the silent failing issues I created #96 so we handle that separately. |
I think that is exactly right :) the silent failing being another issue, I reckon this is a closed one! 😉 |
|
We want to be able to resolve the repo from current working directory. This makes it hard to use outside the docker image
ruby /here/lies/pac/pac.rb --setings=...
Reported by @Sharor
Should use relative path based on current working directory, regardless of where settings file is.
The text was updated successfully, but these errors were encountered: