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

Delete any old artifacts #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

taylorzr
Copy link

@taylorzr taylorzr commented Apr 26, 2019

I had a problem using artifacts with this plugin, I reached out to buildkite and their response included:

I’d suggest that the problem here is that the skip checkout plugin doesn’t clean out the build directory - I guess it’s presuming that nothing ever will be written to the build directory! A patch which adds an rm -rf to the “checkout” hook should fix your issue, and I suspect would be accepted to the plugin itself!

Before buildkite yields to the checkout hook, it cds to the workers build directory, e.g. cd /buildkite/builds/<worker-id>/<myorg>/<pipeline>. So if any artifacts were written in a previous build, they would still exist here.

This PR deletes everything in the build directory so that you don't run into problems with random old artifacts showing up in new builds.

I don't think deleting will cause an issue with the cd option, because it seems like that happens after the checkout hook, in the post-checkout hook.

Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to put together a pull request, with code and tests! 👏🏼🎉 Looks great.

@toolmantim
Copy link
Contributor

toolmantim commented Apr 26, 2019

Whoops, I forgot this was maintained by @thedyrt / @reidab 😁

jasoncodes added a commit to ennova/skip-checkout-buildkite-plugin that referenced this pull request Sep 4, 2022
thedyrt#4

* thedyrt/pr/4:
  Fix tests and add example
  Better glob syntax according to shellcheck
  Clean build directory so old artifacts don't get picked up
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

Successfully merging this pull request may close these issues.

2 participants