Skip to content

travis: Only gox build on tags and go1.7#288

Merged
aeneasr merged 5 commits intoory:masterfrom
emilva:only_gox_build_on_tags
Oct 11, 2016
Merged

travis: Only gox build on tags and go1.7#288
aeneasr merged 5 commits intoory:masterfrom
emilva:only_gox_build_on_tags

Conversation

@emilva
Copy link
Copy Markdown

@emilva emilva commented Oct 6, 2016

Issue #285

Not sure if this fix will work or not, as I could not get it building on my forked repo in travis-ci.
Anyways, something like this should do the trick

Emil Vaagland added 3 commits October 7, 2016 00:12
Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Oct 7, 2016

I think there's still an issue with the travis file:

/home/travis/build.sh: eval: line 46: syntax error: unexpected end of file

https://travis-ci.org/ory-am/hydra/jobs/165746289#L882

@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Oct 7, 2016

It looks like travis executes this as a one-liner which probably causes the issues.

@emilva
Copy link
Copy Markdown
Author

emilva commented Oct 7, 2016

Yeah, will look into that

On 7 October 2016 at 10:54, Aeneas notifications@github.com wrote:

I think there's still an issue with the travis file:

/home/travis/build.sh: eval: line 46: syntax error: unexpected end of file

https://travis-ci.org/ory-am/hydra/jobs/165746289#L882


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#288 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZwplOZz1C3OVhatkFdnNPEbIyzmvLfks5qxgi6gaJpZM4KQf99
.

Best regards

Emil Vaagland

Software Engineer

Schibsted Products & Technology Oslo http://www.schibsted.com

Mob +4792668890

Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Oct 7, 2016

Looks like the issue persists: https://travis-ci.org/ory-am/hydra/jobs/165755242#L883

Are you sure that you can use raw bash in the travis config? Maybe you need to create a little bash script and call it from travis.yml instead.

@boyvinall
Copy link
Copy Markdown
Contributor

boyvinall commented Oct 7, 2016

you can probably use bash as long as it's inside the yaml array. Something like:

after_success:
- [ "${TRAVIS_TAG}" != "" ] && [ "${TRAVIS_GO_VERSION}" == "1.7" ] && gox -ldflags "-X github.com/ory-am/hydra/cmd.Version=`git describe --tags` -X github.com/ory-am/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory-am/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/ {.Dir}}-{{.OS}}-{{.Arch}}"

except ... you need to ensure the leading [ isn't seen as a yaml token, so maybe some sort of heredoc:

after_success:
- |-
  [ "${TRAVIS_TAG}" != "" ] && [ "${TRAVIS_GO_VERSION}" == "1.7" ] && gox -ldflags "-X github.com/ory-am/hydra/cmd.Version=`git describe --tags` -X github.com/ory-am/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory-am/hydra/cmd.GitHash=`git rev-parse HEAD`" -output "dist/ {.Dir}}-{{.OS}}-{{.Arch}}"

Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Oct 11, 2016

Cool, it doesn't throw any errors any more. Not sure if it really works though, yet :D Thanks for the hard work so far. I'll merge it and see what happens!

@aeneasr aeneasr merged commit f5299a1 into ory:master Oct 11, 2016
@emilva
Copy link
Copy Markdown
Author

emilva commented Oct 11, 2016

yeah, should be ok now! Tested the bash syntax in another project, and it worked as expected.

@aeneasr
Copy link
Copy Markdown
Member

aeneasr commented Oct 11, 2016

awesome, thanks so much :)

emilva pushed a commit to emilva/hydra that referenced this pull request Oct 15, 2016
Signed-off-by: Emil Vaagland <emil.vaagland@schibsted.com>
@emilva emilva deleted the only_gox_build_on_tags branch October 17, 2016 18:56
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.

3 participants