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

feat: install latest hugo according to platform #407

Merged
merged 3 commits into from
Oct 25, 2021

Conversation

Harshita-Kanal
Copy link
Contributor

@Harshita-Kanal Harshita-Kanal commented Sep 5, 2021

Summary

The approach here uses the GitHub API to fetch the browser_download_url which is obtained by parsing the JSON response. For windows, this gets the latest zip file of Hugo extended for windows OS. However, the implementation for Mac, Linux is a work in progress.

Related

Fixes #395

Signed-off-by: Harshita-Kanal harshita.kgv@gmail.com

Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
@Harshita-Kanal Harshita-Kanal requested a review from a team as a code owner September 5, 2021 22:13
@jromero jromero marked this pull request as draft September 15, 2021 15:03
Copy link
Member

@jromero jromero left a comment

Choose a reason for hiding this comment

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

Note: We'll also want to add something like:

HUGO_BIN=./tools/bin/hugo

and then use that variable when calling the hugo executable anywhere in the Makefile.

cd tools; mkdir bin; cd bin; curl -L -O $(shell curl https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[30].browser_download_url')

else
@echo $(shell uname -s)
Copy link
Member

Choose a reason for hiding this comment

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

Taken from https://stackoverflow.com/a/12099167/552902

Something like this should work.

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
   // macOS
else
   // assumed linux
endif

@jromero
Copy link
Member

jromero commented Sep 27, 2021

@Harshita-Kanal 👈 (poke)

Is this something you are still interested in resolving. It looks to be so close to being done.

@Harshita-Kanal
Copy link
Contributor Author

@Harshita-Kanal 👈 (poke)

Is this something you are still interested in resolving. It looks to be so close to being done.

Yes just missed it, sorry for the delay!

Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
Signed-off-by: Harshita-Kanal <harshita.kgv@gmail.com>
@Harshita-Kanal
Copy link
Contributor Author

Was able to get it to work for Linux I think. How should we handle the case for Windows?

@Harshita-Kanal Harshita-Kanal marked this pull request as ready for review September 29, 2021 01:35
jromero added a commit that referenced this pull request Oct 25, 2021
Signed-off-by: Javier Romero <root@jromero.codes>
@jromero jromero mentioned this pull request Oct 25, 2021
jromero added a commit that referenced this pull request Oct 25, 2021
@jromero jromero merged commit 5e4972c into buildpacks:main Oct 25, 2021
github-actions bot pushed a commit that referenced this pull request Oct 25, 2021
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.

Installing hugo appears to hang
2 participants