-
Notifications
You must be signed in to change notification settings - Fork 19
Implement Go quickstarter #259
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
Implement Go quickstarter #259
Conversation
Much appreciated, @michaelsauter, will do shortly! |
curl -LO https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz && \ | ||
rm -f *.tar.gz && \ | ||
cd && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelsauter What's the point of the cd
here? Without a parameter, this would just leave you where you are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd
without params brings you to you home directory. But yea, this is pretty pointless here. I will update to cd -
, which brings you back to where you where before the last cd
. I think that's good because then the RUN
command does not change where you are ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually from a maintenance point, I would need to figure out where you are (because that is somewhere in the slave-base). My tendency would be to be as explicit as possible here (putting in an absolute path).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelsauter got it, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rattermeyer I'd consider using WORKDIR
good practice (and is explicit).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WORKDIR
is already set. I will use cd -
, which I still think is best.
Nice work! Also, a great way for me to learn how you've created a new quickstarter from scratch in a single change set. Apart from my quick review above, I would have some suggestions on improving the developer experience for Go developers for your consideration:
If you're interested, feel free to have a look at segmentio/terraform-docs/Makefile for further information. Also, I could point you to the relevant pull requests that implemented these features over there, if helpful. |
boilerplates/be-golang/files/main.go
Outdated
fmt.Fprintln(w, "Hello, world!") | ||
}) | ||
|
||
http.ListenAndServe(":8080", nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see that a valid app and Dockerfile is being built which will deploy without issues compared to https://github.com/opendevstack/ods-project-quickstarters/blob/master/boilerplates/be-docker-plain/files/docker/Dockerfile .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tbugfinder .. File a Bug - and provide a PR ;-) See you uptaking ODS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@metmajer I will look into the suggested changes. While I personally like Go modules, I left it out since the example does not have any dependencies ... and I think it would make the initial setup more complicated, but I'll re-check.
curl -LO https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz && \ | ||
tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz && \ | ||
rm -f *.tar.gz && \ | ||
cd && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd
without params brings you to you home directory. But yea, this is pretty pointless here. I will update to cd -
, which brings you back to where you where before the last cd
. I think that's good because then the RUN
command does not change where you are ...
@michaelsauter oh, it does have some deps. Here's a link to the go.mod file. |
@metmajer Oh yes, your project does have dependencies, but the quickstarter I am building here does not :) |
@michaelsauter Ah, ok :) Here's the idea: if you incorporate a So, even if there are no dependencies yet, |
@michaelsauter and reviewers. I'd like to use this quickstarter already to migrate some application components into it. How do you plan to proceed? |
I'm looking into the feedback now, and suggest to proceed with merging once I made some changes - we can still fine-tune later. |
Very nice, thanks @michaelsauter! |
@metmajer @rattermeyer I've done the following changes now:
My take would be that this is good enough to go in, and we can fine-tune until this ships with 1.2. Agreed? |
I fully agree, @michaelsauter. |
After testing everything, I noticed that @metmajer Unless you disagree with this new approach, I will merge. |
@michaelsauter let me have a quick local test. I'll provide final feedback by Monday morning. Looking forward to using it already :) Cheers! |
@michaelsauter as I understand it, the problem that you see is because we're running
A longer thread on your issue around LGTM to me otherwise! |
@metmajer No, I think you misunderstood the issue. I wanted to run Therefore, I arrived at writing the |
@michaelsauter aah, now I better understand where you're coming from. Thanks! |
Closes #255.
FYI @metmajer Would love to have your input even though I cannot assign you as reviewer atm ...