2015-07-31 23:40:44 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-10-25 05:17:44 +03:00
|
|
|
# Copyright 2019 The Vitess Authors.
|
2017-05-06 02:21:12 +03:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2015-08-07 00:51:46 +03:00
|
|
|
|
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
source $DIR/shell_functions.inc
|
2015-07-31 23:40:44 +03:00
|
|
|
|
2018-12-13 15:02:42 +03:00
|
|
|
# Normal builds run directly against the git repo, but when packaging (for example with rpms)
|
|
|
|
# a tar ball might be used, which will prevent the git metadata from being available.
|
|
|
|
# Should this be the case then allow environment variables to be used to source
|
|
|
|
# this information instead.
|
2022-03-29 22:39:20 +03:00
|
|
|
DEFAULT_BUILD_GIT_REV=$(git rev-parse HEAD)
|
2020-08-26 16:37:12 +03:00
|
|
|
DEFAULT_BUILD_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
2018-12-12 16:19:39 +03:00
|
|
|
|
2017-06-15 08:37:46 +03:00
|
|
|
echo "\
|
2018-02-27 23:39:30 +03:00
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.buildHost=$(hostname)' \
|
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.buildUser=$(whoami)' \
|
2020-08-26 16:37:12 +03:00
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.buildGitRev=${BUILD_GIT_REV:-$DEFAULT_BUILD_GIT_REV}' \
|
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.buildGitBranch=${BUILD_GIT_BRANCH:-$DEFAULT_BUILD_GIT_BRANCH}' \
|
2018-02-27 23:39:30 +03:00
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.buildTime=$(LC_ALL=C date)' \
|
|
|
|
-X 'vitess.io/vitess/go/vt/servenv.jenkinsBuildNumberStr=${BUILD_NUMBER}' \
|
2017-06-15 08:37:46 +03:00
|
|
|
"
|