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

actions: run: Postprocess working directory should be set to the artifact directory #345

Open
elboulangero opened this issue May 30, 2022 · 0 comments · May be fixed by #433
Open

actions: run: Postprocess working directory should be set to the artifact directory #345

elboulangero opened this issue May 30, 2022 · 0 comments · May be fixed by #433

Comments

@elboulangero
Copy link
Contributor

elboulangero commented May 30, 2022

This is what is documented in https://pkg.go.dev/github.com/go-debos/debos/actions#hdr-Run_Action:

  • postprocess -- if set script or command is executed after all other commands and has access to the recipe directory ($RECIPEDIR) and the artifact directory ($ARTIFACTDIR). The working directory will be set to the artifact directory.

In practice, it doesn't seem to be true, the working directory seems to be RECIPEDIR in any case.

Recipe:

architecture: amd64

actions:
  - action: run
    postprocess: true
    command: pwd

Output:

$ debos recipe.yaml 
[...]
2022/05/30 12:34:03 pwd | /home/me/recipes
[...]

$ mkdir d
$ debos --artifactdir=d recipe.yaml 
[...]
2022/05/30 12:34:31 pwd | /home/me/recipes
[...]
@obbardc obbardc self-assigned this Aug 9, 2023
@obbardc obbardc moved this to Todo in Debos development Aug 9, 2023
@obbardc obbardc changed the title The working directory will be set to the artifact directory actions: run: Postprocess working directory should be set to the artifact directory Aug 11, 2023
obbardc added a commit that referenced this issue Aug 15, 2023
Currently any run action tagged as postprocess will be ran in the recipe
directory. The artifacts are stored in this directory by default, unless
--artifactdir is passed to Debos to change where the artifacts are stored.

The run action documentation states:

  postprocess -- if set script or command is executed after all other
  commands and has access to the recipe directory ($RECIPEDIR) and the
  artifact directory ($ARTIFACTDIR). The working directory will be set to
  the artifact directory.

But this is wrong; currently the working directory of postprocess commands
is set to the recipe directory. Set the working directory to the artifact
directory instead to allow postprocess commands to be ran in the correct
location.

Fixes: #345
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit that referenced this issue Aug 15, 2023
Currently any run action tagged as postprocess will be ran in the recipe
directory. The artifacts are stored in this directory by default, unless
--artifactdir is passed to Debos to change where the artifacts are stored.

The run action documentation states:

  postprocess -- if set script or command is executed after all other
  commands and has access to the recipe directory ($RECIPEDIR) and the
  artifact directory ($ARTIFACTDIR). The working directory will be set to
  the artifact directory.

But this is wrong; currently the working directory of postprocess commands
is set to the recipe directory. Set the working directory to the artifact
directory instead to allow postprocess commands to be ran in the correct
location.

Fixes: #345
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit that referenced this issue Jan 10, 2024
Currently any run action tagged as postprocess will be ran in the recipe
directory. The artifacts are stored in this directory by default, unless
--artifactdir is passed to Debos to change where the artifacts are stored.

The run action documentation states:

  postprocess -- if set script or command is executed after all other
  commands and has access to the recipe directory ($RECIPEDIR) and the
  artifact directory ($ARTIFACTDIR). The working directory will be set to
  the artifact directory.

But this is wrong; currently the working directory of postprocess commands
is set to the recipe directory. Set the working directory to the artifact
directory instead to allow postprocess commands to be ran in the correct
location.

Fixes: #345
Signed-off-by: Christopher Obbard <[email protected]>
obbardc added a commit that referenced this issue Jan 10, 2024
Currently any run action tagged as postprocess will be ran in the recipe
directory. The artifacts are stored in this directory by default, unless
--artifactdir is passed to Debos to change where the artifacts are stored.

The run action documentation states:

  postprocess -- if set script or command is executed after all other
  commands and has access to the recipe directory ($RECIPEDIR) and the
  artifact directory ($ARTIFACTDIR). The working directory will be set to
  the artifact directory.

But this is wrong; currently the working directory of postprocess commands
is set to the recipe directory. Set the working directory to the artifact
directory instead to allow postprocess commands to be ran in the correct
location.

Fixes: #345
Signed-off-by: Christopher Obbard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants