-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from flant/new-version
Added `kubedog version` command, refactor build script
- Loading branch information
Showing
5 changed files
with
42 additions
and
14 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 +1 @@ | ||
release-build | ||
release/build |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
package kubedog | ||
|
||
var ( | ||
Version = "dev" | ||
) |
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 -e | ||
|
||
VERSION=$1 | ||
|
||
if [ -z "$VERSION" ] ; then | ||
echo "Usage: $0 VERSION" | ||
echo | ||
exit 1 | ||
fi | ||
|
||
RELEASE_BUILD_DIR=$(pwd)/release/build | ||
|
||
rm -rf $RELEASE_BUILD_DIR | ||
|
||
for arch in linux darwin ; do | ||
outputDir=$RELEASE_BUILD_DIR/$arch-amd64 | ||
|
||
mkdir -p $outputDir | ||
|
||
echo "Building kubedog for $arch, version $VERSION" | ||
GOOS=$arch GOARCH=amd64 go build -ldflags="-s -w -X github.com/flant/kubedog/pkg/kubedog.Version=$VERSION" -o $outputDir/kubedog github.com/flant/kubedog/cmd/kubedog | ||
|
||
echo "Calculating checksum kubedog.sha" | ||
sha256sum $outputDir/kubedog | cut -d' ' -f 1 > $outputDir/kubedog.sha | ||
done |