forked from kubernetes-retired/bootkube
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
83 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
bin/ | ||
_output | ||
vendor-v[0-9].[0-9].[0-9]/ | ||
|
||
hack/*/.vagrant/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
BOOTKUBE_ROOT=${SCRIPT_DIR}/.. | ||
BOOTKUBE_RELEASE=${BOOTKUBE_BIN:-${BOOTKUBE_ROOT}/_output/release/bootkube-linux-amd64.tar.gz} | ||
DOCKER_REPO=${DOCKER_REPO:-quay.io/coreos/bootkube} | ||
DOCKER_TAG=${DOCKER_TAG:-$(${BOOTKUBE_ROOT}/build/git-version.sh)} | ||
DOCKER_PUSH=${DOCKER_PUSH:-false} | ||
|
||
sudo rkt run \ | ||
--volume bk,kind=host,source=${BOOTKUBE_ROOT} \ | ||
--mount volume=bk,target=/go/src/github.com/coreos/bootkube \ | ||
--insecure-options=image docker://golang:1.6.2 --exec /bin/bash -- -c \ | ||
"cd /go/src/github.com/coreos/bootkube && make clean release" | ||
|
||
TEMPDIR=$(mktemp -d -t bootkube.XXXX) | ||
|
||
printf "FROM scratch\nCOPY bootkube /bootkube" > ${TEMPDIR}/Dockerfile | ||
tar xzvf ${BOOTKUBE_RELEASE} -C ${TEMPDIR} | ||
docker build -t ${DOCKER_REPO}:${DOCKER_TAG} ${TEMPDIR} | ||
rm -rf ${TEMPDIR} | ||
|
||
if [[ ${DOCKER_PUSH} == "true" ]]; then | ||
docker push ${DOCKER_REPO}:${DOCKER_TAG} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# parse the current git commit hash | ||
COMMIT=$(git rev-parse HEAD) | ||
|
||
# check if the current commit has a matching tag | ||
TAG=$(git describe --exact-match --abbrev=0 --tags ${COMMIT} 2> /dev/null || true) | ||
|
||
# use the matching tag as the version, if available | ||
if [ -z "$TAG" ]; then | ||
VERSION=$COMMIT | ||
else | ||
VERSION=$TAG | ||
fi | ||
|
||
# check for changed files (not untracked files) | ||
if [ -n "$(git diff --shortstat 2> /dev/null | tail -n1)" ]; then | ||
VERSION="${VERSION}-dirty" | ||
fi | ||
|
||
echo $VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package version | ||
|
||
var Version string = "none" |