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 · 7 comments
Open

Clear build cache #98

jennybc opened this issue Nov 23, 2017 · 7 comments

Comments

@jennybc
Copy link
Contributor

@jennybc 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

This comment has been minimized.

Copy link
Owner

@krlmlr 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

This comment has been minimized.

Copy link
Contributor

@jimhester 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

This comment has been minimized.

Copy link
Contributor Author

@jennybc 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

This comment has been minimized.

Copy link
Owner

@krlmlr 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

This comment has been minimized.

Copy link

@aryoda 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

This comment has been minimized.

Copy link

@cboettig 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

This comment has been minimized.

Copy link
Owner

@krlmlr 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.