Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Oct 2, 2018

Builds on #396; review that first.

I've stuck Git tagging in there too, because why not. This is mostly to get our list of target OSes and architectures into version control.

The SKIP_GENERATION variable allows you to turn off vfsgen when we have GOOS and/or GOARCH set to values that will not run on your host ;).

I'd added this in f230c3e (hack/build: Add the local vendor directory
for generate, 2018-09-26, openshift#340), citing [1].  But:

* vendor/ is not a useful GOPATH addition, because it lacks the src/
  that Go requires.  Go might look in vendor/src/github.com/... with
  our GOPATH stuffing, but that won't help it find our vendored
  libraries.

* All that really seems to matter is whether the repository as a whole
  is checked out into your GOPATH.

I'm really looking forward to Go 1.11's modules killing the GOPATH
idea.

[1]: golang/go#20406

Reported-by: Stephen Augustus <saugustu@redhat.com>
@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 2, 2018
@abhinavdahiya
Copy link
Contributor

@wking can we make our binaries getable like this.

https://github.com/openshift/installer/blob/master/hack/get-terraform.sh#L26

The zip file is named according to arch and os but the internal binary is always openshift-install

And stick Git tagging in there too, because why not.  This is mostly
to get our list of target OSes and architectures into version control.

The SKIP_GENERATION variable allows you to turn off vfsgen when we
have GOOS and/or GOARCH set to values that will not run on your host
;).

Also change --abbrev from 0 to 40 in the build script, because
--abbrev=0 results in dropping the commit hash entirely when there's a
past tag:

  $ git describe --always --abbrev=40 --dirty
  v0.1.0-2-gff5ee75e5010efb305d4bc381d944b14a4a97c3b-dirty
  $ git describe --always --abbrev=0 --dirty
  v0.1.0-dirty
  $ git describe --always --dirty
  v0.1.0-2-gff5ee75-dirty

Checking on the tag itself for sanity:

  $ git checkout v0.1.0
  $ git describe --always --abbrev=40 --dirty
  v0.1.0
@wking wking force-pushed the release branch 2 times, most recently from 292586b to 7b02330 Compare October 3, 2018 02:00
@wking
Copy link
Member Author

wking commented Oct 3, 2018

can we make our binaries getable like this.

https://github.com/openshift/installer/blob/master/hack/get-terraform.sh#L26

The zip file is named according to arch and os but the internal binary is always openshift-install

We could. But why zip the files at all? Currently you can:

$ curl -s https://github.com/openshift/installer/releases/download/v0.1.0/openshift-install-linux-amd64 >~/bin/openshift-install

With zips, you'd:

$ curl -s https://github.com/openshift/installer/releases/download/v0.1.0/openshift-install-linux-amd64.zip | funzip >~/bin/openshift-install

The former seems simpler to me.

@abhinavdahiya
Copy link
Contributor

For now this seems okay

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [abhinavdahiya,wking]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit e4c8898 into openshift:master Oct 4, 2018
@wking wking deleted the release branch October 4, 2018 22:12
wking added a commit to wking/openshift-installer that referenced this pull request Nov 22, 2018
This gets the correct main.version value.  Before this commit, you
could have:

  $ hack/release.sh v0.4.0
  ...
  + go build -ldflags ' -X main.version=v0.3.0-273-g...' ...
  ...

With this commit, that same invocation will give you:

  + go build -ldflags ' -X main.version=v0.4.0' ...

The bug is from the initial script in 7b02330 (hack/release: Make it
easy to cross-compile release binaries, 2018-10-02, openshift#397).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants