Commit Graph

38 Commits

Author SHA1 Message Date
Davanum Srinivas
ec71e53adb
Ensure we are using GNU date for builds
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-10-20 10:12:23 -04:00
HaoJie Liu
4990214c6f
Remove invalid comments in hack/lib/version.sh
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>
2022-07-06 19:19:29 +08:00
Jordan Liggitt
a26f7f2b58 Add non-vendor version ldflags 2021-08-14 11:20:26 -04:00
llhuii
36aa8a24ce hack/lib/version.sh: fix error log to stderr
Since this invalid Semantic Version messages redirecting to stdout
will be captured by line 790 at hack/lib/golang.sh:
`goldflags="${GOLDFLAGS=-s -w -buildid=} $(kube::version::ldflags)"`

This happens when only no valid tag exists in repo
2021-01-31 00:40:53 +08:00
Hannes Hörl
6b1d1ccbf5 Allow users to use custom tags
When discovering the kube version we only consider tags that match the
glob 'v*'. By doing so users can create/use their custom tags as long as
they don't look like a version (starting with a 'v').

We already do a similar thing when building the pause container, see how
the `REV` is set in git.k8s.io/kubernetes/build/pause/Makefile.
2019-10-04 12:18:18 +03:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Han Kang
b037203082 move version logic directly into the component-base, to simplify legacyregistry logic
add version to vendor

move version into component-base top-level

update bazel build files

fix import
2019-08-21 09:43:20 -07:00
Sean Sullivan
fb44be2d97 Move pkg/kubectl/version to staging 2019-07-26 15:48:09 -07:00
SataQiu
298909e20e kubeadm: use local copy of kubectl's version package 2019-07-16 09:51:10 +08:00
Benjamin Elder
59c4eb2a38 fix hack/lib/version.sh shellcheck failures 2019-06-26 09:20:17 -07:00
Sean Sullivan
d4d6e19f1e kubectl: removes pkg/version dependency 2019-03-28 16:08:34 -07:00
Andy Xie
3e53e99aae log bad format git version 2018-05-22 23:49:50 +08:00
Matthias Bertschy
9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Jeff Grafton
7713453356 Exclude commas when pulling the tag out of the git export-subst format string 2018-03-12 15:20:22 -07:00
Chen Zhiwei
3b8b9e6a24 Build Kubernetes binaries with valid Semantic Version 2018-01-31 12:59:52 +08:00
Ryan Phillips
63e2eacd22 add semver metadata regex
* supports v1.9.0+stable.0
2017-12-19 15:04:56 -06:00
Kubernetes Submit Queue
cdbfff0773
Merge pull request #57222 from xialonglee/keep-ldfalgs-spaces-safe
Automatic merge from submit-queue (batch tested with PRs 55475, 57155, 57260, 57222). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make sure that 'ldflags' are space-safe

**What this PR does / why we need it**:
Recently I met the problem as #56216 described, I download the source-tar of 1.8.5 and run `make` command failed because of invalid ldflag: 
 `-X k8s.io/kubernetes/pkg/version.gitTreeState=git archive`

Though #56249 has change version string `git archive` to `archive`, i think we should avoid this problem happen again.

cc @ixdy 

**Release note**: NONE
2017-12-18 19:45:46 -08:00
xialonglee
4a999d73e3 make sure that 'ldflags' are spaces safe 2017-12-15 11:15:24 +08:00
Jonathan MacMillan
e830b5390b Fix a comment in hack/lib/version.sh about which tags are used to get the version. 2017-12-05 19:00:16 -08:00
Jeff Grafton
2b04a66df7 Rename tree state from 'git archive' to 'archive' 2017-11-22 12:19:38 -08:00
David McMahon
9a9d11bb75 Capture git export-subst strings in version.sh for 'git archive' use.
Eliminate the need to update pkg/version/base.go on release branch tagging.
2017-11-09 16:36:27 -08:00
Bernhard M. Wiedemann
cd0e7b9e17 Allow to override build date
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
2017-07-19 13:27:13 +02:00
Jeff Grafton
64bd79fad7 Convert go_binary linkstamp to x_defs 2017-06-08 14:59:55 -07:00
Jordan Liggitt
2d06607885
Fix v0.0.0 in kubectl built from master 2017-03-07 01:09:57 -05:00
Piotr Skamruk
66a85555a2 build: Fix version generation. 2016-10-17 09:13:22 +02:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Tim Hockin
527cb50583 Demand at least go1.6 2016-05-08 20:30:37 -07:00
Isaac Hollander McCreery
215872613b Revert "Always use long format in git tag." 2016-04-26 15:03:15 -07:00
Joe Finney
9ba006572a Always use long format in git tag. 2016-03-17 15:07:25 -07:00
Jeff Grafton
fb663f2cd5 Include Go version, platform, and other build info in version string
Additionally update MatchesServerVersion to only check GitVersion,
GitCommit, and GitTreeState.
2016-03-14 13:55:28 -07:00
Eric Paris
cbc4581bd6 Default to allow new golang versions
Out tests for features that didn't exist in old golang versions (like
gofmt didn't exist in 1.3 or the linker didn't want an = in 1.4) checked
for the new version. But this means every time there is a new version we
have to update the test. This PR inverts the test. We do it the old way
for the old version and if a new version comes along we just assume it
is going to work the new way.
2016-03-07 09:57:36 -05:00
Mike Danese
0269e2baad Merge pull request #11941 from GoogleCloudPlatform/enact_version_md
Enacting versioning.md
2015-07-31 10:17:22 -07:00
Zach Loafman
4363f14e77 Enacting versioning.md
This PR changes how we version going forward in the following ways:

* mark-new-version.sh is changed to a new policy of just splitting
branches, rather than the old backmerge policy, as discussed in
vX.Y.0, and a tag for vX.(Y+1).0-alpha.0 back to master.

* I eliminated PRs back to master by making the version/base.go
gitVersion and gitCommit just be `export-subst`. I testing that this
works with GitHub's source export tarballs. There's no reason to
bother with forcing the version into `base.go` (especially twice). The
tarball versions outside a git tree aren't perfect (master looks like
"v0.0.0+hash", and the release branches look more accurate), but our
build contract has never allowed that version is perfect in this
situation, so I think we can relax this.

* That master tag gets picked up by "git describe" on master, so e.g.
master would have immediately become v1.1.0-alpha.0

* In order to be more semVer compatible, the gitVersion field for the
master branch now looks something like 1.1.0-alpha.0.6+84c76d1142ea4d.
This is a tiny translation of the "git describe". I did this because
there are a ton of consumers out there of the "gitVersion" field
expecting it to be the full version, but it would be nice if this
field were actually semver compliant. (1.1.0-alpha.0-6-84c76d1142ea4d
is, but it's not *usefully* so.)

Fixes #11495
2015-07-28 11:58:44 -07:00
Jan Chaloupka
3a90386c78 golang 1.4 was happy with -X key val
golang 1.5 complains ans wants -X key=val
2015-07-24 16:56:18 +02:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Brendan Burns
373cf77ae1 Adjust the regexp so that we can handle extra sub versions. 2014-12-02 23:00:01 -08:00
Joe Beda
e02322ba4e Use all tags for version detection 2014-11-11 11:20:19 -08:00
Joe Beda
5d33ce46cc Rework hack/ and build/ directories.
* Rewrite a bunch of the hack/ directory with modular reusable bash libraries.
* Have 'build/*' build on 'hack/*'.  The stuff in build now just runs hack/* in a docker container.
* Use a docker data container to enable faster incremental builds.
* Standardize output to _output/{local,dockerized}/bin/OS/ARCH/*.  This regularized placement makes cross compilation work.
* Move travis specific scripts under hack/travis

With new dockerized incremental builds, I can do a no-op `make quick-release` in ~30s.  This is a significant improvement.
2014-11-01 17:56:41 -07:00