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

Improve build script #250

Merged
merged 1 commit into from
Apr 8, 2019
Merged

Improve build script #250

merged 1 commit into from
Apr 8, 2019

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Apr 8, 2019

  • Use single gox command to parallelize build.
  • Automatically package any archs gox spits out.
  • Add sha256sums for packages.

@codecov
Copy link

codecov bot commented Apr 8, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@56b5fb9). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #250   +/-   ##
=========================================
  Coverage          ?   88.28%           
=========================================
  Files             ?        2           
  Lines             ?      683           
  Branches          ?        0           
=========================================
  Hits              ?      603           
  Misses            ?       57           
  Partials          ?       23

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56b5fb9...2afc896. Read the comment docs.

* Use single gox command to parallelize build.
* Automatically package any archs gox spits out.
* Add sha256sums for packages.
@oliver006
Copy link
Owner

Nice, this is a lot better than what we got right now.

@oliver006 oliver006 merged commit e0906c8 into oliver006:master Apr 8, 2019
@oliver006
Copy link
Owner

oliver006 commented Apr 9, 2019

Release failed: https://cloud.drone.io/oliver006/redis_exporter/198/1/8


GO_LDFLAGS: -s -w -extldflags "-static" -X main.VERSION=v0.33.0 -X main.COMMIT_SHA1=09b985767518c57735b7f11b66c15808c4561db4 -X main.BUILD_DATE=2019-04-09-17:37:28
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
ignoring go.mod;
see 'go help modules'
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
ignoring go.mod;
see 'go help modules'
go: modules disabled inside GOPATH/src by GO111MODULE=auto; see 'go help modules' 

Do the go build commands in the build script need the -mod=vendor flag as well?

@oliver006
Copy link
Owner

oliver006 commented Apr 9, 2019

I guess I could add -mod=vendor to the GO_LDFLAGS variable? nope, ldflags are for the linker.

Hmm, looks like gox currently doesn't support passing the vendor flag: mitchellh/gox#122

@SuperQ SuperQ deleted the build branch April 9, 2019 17:43
@SuperQ
Copy link
Contributor Author

SuperQ commented Apr 9, 2019

Hrm, I don't know how gox passes in those flags. You might need to add GO111MODULE: on in the env section of the drone config.

@oliver006
Copy link
Owner

Good suggestion, let me try that.

@SuperQ
Copy link
Contributor Author

SuperQ commented Apr 9, 2019

It may also need -mod=vendor on the GO_LDFLAGS in order to enforce the use of the vendor dir.

@oliver006
Copy link
Owner

Setting the env var seems to have fixed the build, now on to the next issue:

rm: cannot remove 'dist/redis_exporter-v0.33.0.windows-386.zip': No such file or directory

I guess we got to ignore errors here cause for the first zip there's nothing to delete.

@SuperQ
Copy link
Contributor Author

SuperQ commented Apr 9, 2019

Ahh, yea, [[ -f $f ]] && rm $f. Forgot that rm fails on removal of nothing.

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.

2 participants