-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Publish binaries to GitHub Releases #766
Conversation
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
scripts/travis/build-windows.sh
Outdated
@@ -0,0 +1,5 @@ | |||
#!/bin/bash |
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.
is this script necessary? I.e. why not just call make build-windows
from .travis?
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.
Yup, I can move it to just running make build-windows
from .travis.yml. I was following convention and created a script file. I'll change that up.
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.
Let's be nice to the next person that will touch this feature and keep it consistent with the other parts of the build :)
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.
I'm confused by the two comments - should I use make build-windows
or call the script?
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.
I would say that the script is desirable, for consistency's sake. But @yurishkuro has the final word on this.
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.
Personally I prefer minimalist approach, of the script doesn't add anything then why have it?
But since it's here already, it's fine to leave it.
Makefile
Outdated
.PHONY: build-agent-linux | ||
build-agent-linux: | ||
CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o ./cmd/agent/agent-linux $(BUILD_INFO) ./cmd/agent/main.go | ||
|
||
.PHONY: build-agent-windows | ||
build-agent-windows: | ||
CGO_ENABLED=0 GOOS=windows installsuffix=cgo go build -o ./cmd/agent/agent-windows.exe $(BUILD_INFO) ./cmd/agent/main.go |
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.
Any reason not to call this agent.exe
? Is there any other platform that uses .exe
extension?
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.
Just following convention since the agent for linux is called agent-linux
. I'll change it up to be agent.exe
.
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.
@yurishkuro what if we named the different binaries for windows along the lines of jaeger.<product>.exe
and dropped the -windows
on all of them?
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.
my preference would be to have identical names but group them into dirs/archives by target, e.g.
jaeger-1.4.0-darwin-amd64.tar.gz
- jaeger-agent
- jaeger-collector
- etc
jaeger-1.4.0-linux-amd64.tar.gz
- jaeger-agent
- jaeger-collector
- etc
jaeger-1.4.0-windows-amd64.tar.gz
- jaeger-agent.exe
- jaeger-collector.exe
- etc
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.
I like it. I'll work on getting that setup @yurishkuro.
.travis.yml
Outdated
|
||
after_success: | ||
- if [ "$COVERAGE" == true ]; then travis_retry goveralls -coverprofile=cover.out -service=travis-ci || true ; else echo 'skipping coverage'; fi | ||
|
||
after_failure: | ||
- if [ "$CROSSDOCK" == true ]; then make crossdock-logs ; else echo 'skipping crossdock'; fi | ||
|
||
deploy: |
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.
I am not familiar with travis deploy workflow - where do these files end up? And do we need a different naming conventions? E.g. https://prometheus.io/download/:
prometheus-2.2.1.darwin-amd64.tar.gz
prometheus-2.2.1.linux-amd64.tar.gz
prometheus-2.2.1.windows-amd64.tar.gz
Also, since these are archive files, do we want to bundle all binaries into one archive?
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.
also, we should change these commands to only build and deploy these binaries on landing the PR rather than every commit (unless this already does this)
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.
Those files will end up as individual assets over at the release message (e.g. https://github.com/jaegertracing/jaeger/releases/tag/v1.3.0). That's why we need someone to supply a token at YOUR_API_KEY_ENCRYPTED
- it allows pushing the files back to GitHub.
Because we have on.tags: true
Travis will only push files back to a release message when the commit has a tag. We could also add branch: master
to further pin down when it deploys.
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.
We could also add
branch: master
to further pin down when it deploys.
I don't think that's what we want:
GitHub Releases uses git tags. If the build commit does not have any tags, one will be created in the form of
untagged-*
, where*
is a random hex string.
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.
@jpkrohling I think that's only if you have on.branch: true
. I was thinking that if you had multiple on
options it would only deploy if all conditions were met. I'll look into it.
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.
I verified from the Travis docs:
When all conditions specified in the
on:
section are met, your build will deploy.
So if we have on.tags: true
and on.branch: master
it will only deploy when it's a commit on master that has a tag already.
fwiw we should fix it using binary assets |
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
I pushed up some new commits:
|
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
.travis.yml
Outdated
@@ -54,9 +63,34 @@ script: | |||
- if [ "$DOCKER" == true ]; then bash ./scripts/travis/build-docker-images.sh ; else echo 'skipping docker images'; fi | |||
- if [ "$ES_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/es-integration-test.sh ; else echo 'skipping elastic search integration test'; fi | |||
- if [ "$HOTROD" == true ]; then bash ./scripts/travis/hotrod-integration-test.sh ; else echo 'skipping hotrod example'; fi | |||
- if [ "$LINUX" == true ]; then make build-linux ; else echo 'skipping linux'; fi | |||
- if [ "$WINDOWS" == true ]; then make build-windows ; else echo 'skipping windows'; fi | |||
- if [ "$DARWIN" == true ]; then make build-darwin ; else echo 'skipping darwin'; fi |
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.
overall this looks good, but this 3 additions concern me as they are going to significantly increase Travis build times. I'd rather have a single DEPLOY=true step that would build files for all targets, which would be a lot faster since we don't have to wait for Travis VM/container to initialize.
Also, there's now a huge amount of duplication in the make file, I think it could be simplified a lot through variables, similar to the deploy.sh file, e.g.
linux-binaries:
make build-agent build-collector ... GOOS=darwin
build-agent:
CGO_ENABLED=0 GOOS=$(GOOS) ...
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.
in fact, DEPLOY=true doesn't even need to be a new matrix entry, we can co-locate it with the DOCKER=true entry (since it requires linux binaries anyway).
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.
Thanks for the input @yurishkuro! I'll have time closer to the middle of this week to make these changes.
also, correct the travis deploy to deploy the tar.gz files Signed-off-by: Jon Carl <jon.carl.42@gmail.com>
@yurishkuro I've made the changes we talked about above - decreased the duplication a good bit. I left Is there any other changes needed on this? I think I covered all the feedback. The one thing that will need to be done before the merge is setting the deploy key for travis to push the artifacts to GitHub - this will need to be done by someone who has access to publish release artifacts. |
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.
lgtm - I'll merge so that I can tweak the API key, etc.
This is for #765. It will build executables for windows and in the travis job it will publish the windows and linux binaries with the GitHub release when the build is tagged. Out of the box the standalone binary and the query binary won't work as they need the UI files location specified.
Also, before this is merged someone with access to the repo will have to add a secure key to the travis deploy so the files can be sent along to GitHub.