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

Clear build cache #98

Open
jennybc opened this issue Nov 23, 2017 · 9 comments
Open

Clear build cache #98

jennybc opened this issue Nov 23, 2017 · 9 comments

Comments

@jennybc
Copy link
Contributor

jennybc commented Nov 23, 2017

It would be great to have a convenience function to clear the build cache, at least until AppVeyor provides a Large Handy Button.

appveyor/ci#985

This is the API call:

DELETE https://ci.appveyor.com/api/projects/{accountName}/{projectSlug}/buildcache

so the main point would be to send the appropriate Bearer token in the header. I myself am using GitHub for auth, so now I'm going to try to figure out what that should be ...

Update: this seems to work but requires your AppVeyor API token:

export APPVEYOR_TOKEN="abcdefghijklmnopqrstuvwxyz"
curl -X "DELETE" -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" https://ci.appveyor.com/api/projects/{accountName}/{projectSlug}/buildcache

but I wonder if there's a way to somehow do this with a GITHUB_PAT.

@krlmlr
Copy link
Owner

krlmlr commented Dec 7, 2017

AppVeyor uses its own authentication, unlike Travis CI which relies solely on GitHub.

This would be a good feature for a package that wraps the AppVeyor API. I'm not aware of any such package, but it would be nice to have, e.g. to set up testing. Could also be part of https://github.com/ropenscilabs/travis.

Adding an artificial dependency for the cache will require a dummy commit to invalidate the cache, but may serve as simple workaround: https://www.appveyor.com/docs/build-cache/

@jimhester
Copy link
Contributor

jimhester commented Jun 6, 2018

FWIW the "easiest" way I have found to do this is to delete the cache in the javascript console while you are logged into appveyor, e.g. appveyor/ci#985 (comment)

@jennybc
Copy link
Contributor Author

jennybc commented Jun 6, 2018

Thanks @jimhester! I'm inlining that because I use this issue as my personal sticky note on how to do this.

In the javascript console on appveyor:

$.ajax({
    url: 'https://ci.appveyor.com/api/projects/<username>/<project>/buildcache',
    type: 'DELETE'})

Also, for this to work, you must be logged in to AppVeyor. In the upper right corner, you should NOT see "Sign In".

@krlmlr
Copy link
Owner

krlmlr commented Jul 4, 2019

FWIW there is https://github.com/cloudyr/appveyor, which might be a slightly easier way than httr or curl. Haven't tried it yet.

@aryoda
Copy link

aryoda commented Oct 1, 2019

Update: this seems to work but requires your AppVeyor API token:

export APPVEYOR_TOKEN="abcdefghijklmnopqrstuvwxyz"
curl -X "DELETE" -H "Authorization: Bearer $APPVEYOR_TOKEN" -H "Content-Type: application/json" https://ci.appveyor.com/api/projects/{accountName}/{projectSlug}/buildcache

This is working without JavaScript but the above link to the API token is outdated (now called "API keys"):

  1. The APPVEYOR_TOKEN ("Bearer") can be seen after login here (another link the in the first post): https://ci.appveyor.com/api-keys
  2. The REST API to delete the cache is documented here:
    https://www.appveyor.com/docs/api/projects-builds/#delete-project-build-cache

@cboettig
Copy link

cboettig commented Oct 1, 2019

On @jimhester's advice, I've found the simplest thing to do is just removing or commenting out the cache line from the appveyor.yml. Caching the package install doesn't tend to save much time in my experience anyhow, since most of the packages can already be installed in binary form from CRAN.

@krlmlr
Copy link
Owner

krlmlr commented Dec 29, 2019

In my experience, caching tends to cause trouble on Windows and doesn't speed up installation a lot, especially now that PKGTYPE defaults to "binary".

Are there any strong reasons to use caching?

@vladimiry
Copy link

vladimiry commented Feb 20, 2020

DELETE https://ci.appveyor.com/api/projects/{accountName}/{projectSlug}/buildcache

That Rest call doesn't remove the cache anymore. Am I the one who experience the issue? Worked well before. Now I call it, get 204 status code which is ok, but the cache doesn't get removed.

@TheQwertiest
Copy link

Yup, same here. 204 status , but the cache is still there.

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

7 participants