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

Adding REF to GitHub repo HEAD for cache busting #137

Closed
wants to merge 2 commits into from
Closed

Adding REF to GitHub repo HEAD for cache busting #137

wants to merge 2 commits into from

Conversation

robellegate
Copy link
Contributor

After installing requirements, check if HEAD has changed and bust cache for RUN instruction for wget archive

After installing requirements, check if  HEAD has changed and bust cache for RUN instruction for wget  archive
@cimnine
Copy link
Collaborator

cimnine commented May 24, 2019

Interesting approach!

@cimnine
Copy link
Collaborator

cimnine commented May 24, 2019

One problem is though that there is no generic way to make it work with tags:

https://api.github.com/repos/digitalocean/netbox/git/refs/heads/master ✅ 
https://api.github.com/repos/digitalocean/netbox/git/refs/heads/v2.5.12 ❌
https://api.github.com/repos/digitalocean/netbox/git/refs/tags/v2.5.12 ❗️ 

@robellegate
Copy link
Contributor Author

robellegate commented May 24, 2019

A possible workaround to that would be to just query https://api.github.com/repos/digitalocean/netbox/git/refs and if any HEAD or TAG changes to redownload the netbox archive. This solution definitely isn't optimal especially if other refs are being worked on at the same time.

Another option would be to change the archive download REF_URL to https://api.github.com/repos/digitalocean/netbox/contents?ref=$BRANCH, which would work with both heads and tags and should have the same functionality as the original REF_URL

Per [dicsuccion](#137 (comment)) with @cimnine, changing the API endpoint to one that retains functionality of previous URL while supporting both HEADS and TAGS
@cimnine
Copy link
Collaborator

cimnine commented Jun 12, 2019

This was manually merged in a5537b1. Thanks for the PR!

@cimnine cimnine closed this Jun 12, 2019
@robellegate robellegate deleted the improved_build_speed branch June 13, 2019 12:49
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.

None yet

2 participants