-
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.
Continue integration support for build (#1)
* fix build script * now create space * changed make source to warn on testing * ci automation now functions
- Loading branch information
1 parent
cd14b47
commit 159580e
Showing
10 changed files
with
220 additions
and
11 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
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
go build -o ./bin/dremio-batch-execute. | ||
go build -o ./bin/dremio-batch-execute ./cmd/dremio-batch-execute/ |
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 @@ | ||
#!/bin/sh | ||
|
||
go tool cover -func=coverage.out |
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,55 @@ | ||
#!/bin/sh | ||
|
||
# scripts/release: build binaries in all supported platforms and upload them with the gh client | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
BIN_NAME="dremio-batch-execute" | ||
echo "Checking if gh is installed…" | ||
date "+%H:%M:%S" | ||
|
||
if ! type "gh" > /dev/null; then | ||
echo "gh not found installing…" | ||
date "+%H:%M:%S" | ||
OS="`uname`" | ||
case $OS in | ||
'Linux') | ||
if type "apt" > /dev/null; then | ||
echo "detected debian based system installing via apt" | ||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | ||
sudo apt update -y | ||
sudo apt install gh -y | ||
fi | ||
if type "yum" > /dev/null; then | ||
echo "detected rpm based system installing via yum" | ||
sudo dnf install 'dnf-command(config-manager)' -y | ||
sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo | ||
sudo dnf install gh -y | ||
fi | ||
;; | ||
'WindowsNT') | ||
echo "install gh and try again https://github.com/cli/cli/releases" | ||
exit 1 | ||
;; | ||
'Darwin') | ||
if type "brew" > /dev/null; then | ||
brew install gh | ||
else | ||
echo "install homebrew to have zip https://brew.sh/" | ||
exit 1 | ||
fi | ||
;; | ||
*) ;; | ||
esac | ||
fi | ||
|
||
# this is also set in scripts/build-release and is a copy paste | ||
GIT_SHA=`git rev-parse --short HEAD` | ||
VERSION=$1 | ||
|
||
./scripts/release-build $VERSION | ||
|
||
gh release create $VERSION --title $VERSION --generate-notes ./bin/$BIN_NAME-windows-arm64.zip ./bin/$BIN_NAME-windows-amd64.zip ./bin/$BIN_NAME-darwin-arm64.zip ./bin/$BIN_NAME-darwin-amd64.zip ./bin/$BIN_NAME-linux-arm64.zip ./bin/$BIN_NAME-linux-amd64.zip |
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,71 @@ | ||
#!/bin/sh | ||
|
||
# scripts/release-build: build binaries in all supported platforms | ||
|
||
echo "Checking if zip is installed…" | ||
date "+%H:%M:%S" | ||
BIN_NAME="dremio-batch-execute" | ||
|
||
if ! type "zip" > /dev/null; then | ||
echo "zip not found installing…" | ||
date "+%H:%M:%S" | ||
OS="`uname`" | ||
case $OS in | ||
'Linux') | ||
if type "apt" > /dev/null; then | ||
echo "detected debian based system installing via apt" | ||
sudo apt install zip | ||
fi | ||
if type "yum" > /dev/null; then | ||
echo "detected rpm based system installing via yum" | ||
sudo yum install zip | ||
fi | ||
;; | ||
'WindowsNT') | ||
echo "install gnu zip and try again http://gnuwin32.sourceforge.net/packages/zip.htm" | ||
exit 1 | ||
;; | ||
'Darwin') | ||
if type "brew" > /dev/null; then | ||
brew install zip | ||
else | ||
echo "install homebrew to have zip https://brew.sh/" | ||
exit 1 | ||
fi | ||
;; | ||
*) ;; | ||
esac | ||
fi | ||
# this is also set in script/build and is a copy paste | ||
GIT_SHA=`git rev-parse --short HEAD` | ||
VERSION=$1 | ||
LDFLAGS="-X github.com/rsvihladremio/$BIN_NAME/pkg/output.GitSha=$GIT_SHA -X github.com/rsvihladremio/$BIN_NAME/pkg/output.Version=$VERSION" | ||
|
||
echo "Cleaning bin folder…" | ||
date "+%H:%M:%S" | ||
./scripts/clean | ||
|
||
echo "Building linux-amd64…" | ||
date "+%H:%M:%S" | ||
GOOS=linux GOARCH=amd64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-linux-amd64.zip ./bin/$BIN_NAME | ||
echo "Building linux-arm64…" | ||
date "+%H:%M:%S" | ||
GOOS=linux GOARCH=arm64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-linux-arm64.zip ./bin/$BIN_NAME | ||
echo "Building darwin-os-x-amd64…" | ||
date "+%H:%M:%S" | ||
GOOS=darwin GOARCH=amd64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-darwin-amd64.zip ./bin/$BIN_NAME | ||
echo "Building darwin-os-x-arm64…" | ||
date "+%H:%M:%S" | ||
GOOS=darwin GOARCH=arm64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-darwin-arm64.zip ./bin/$BIN_NAME | ||
echo "Building windows-amd64…" | ||
date "+%H:%M:%S" | ||
GOOS=windows GOARCH=amd64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME.exe ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-windows-amd64.zip ./bin/$BIN_NAME.exe | ||
echo "Building windows-arm64…" | ||
date "+%H:%M:%S" | ||
GOOS=windows GOARCH=arm64 go build -ldflags "$LDFLAGS" -o ./bin/$BIN_NAME.exe ./cmd/$BIN_NAME/ | ||
zip ./bin/$BIN_NAME-windows-arm64.zip ./bin/$BIN_NAME.exe |
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,3 @@ | ||
#!/bin/sh | ||
|
||
go test -race -cover -coverprofile=coverage.out ./... | ||
go tool cover -func=coverage.out | ||
go test -race -cover -coverprofile=coverage.out ./... |