Skip to content

Commit

Permalink
build_all.sh- move build_template to its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Apr 17, 2022
1 parent 91cf5ee commit 83bae88
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
16 changes: 3 additions & 13 deletions build_all.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
#!/usr/bin/env bash

build_template() {
export CGO_ENABLED=1
export GOOS=$1
export GOARCH=$2
export GOARM=7
ext=$3
date=$(date +'%Y%m%d')
version=${CIRCLE_BUILD_NUM-$date}
tag=v$version
echo $tag-$GOOS-$GOARCH
go build -ldflags="-s -w -X main.Version=$tag" -o ./bin/mantle-$tag-$GOOS-$GOARCH$ext
}
set -e

GOPATH=$(go env GOPATH)
go get -v github.com/rakyll/statik
$GOPATH/bin/statik -src="./www/" -f

build_template linux amd64
./build_go.sh linux amd64
14 changes: 14 additions & 0 deletions build_go.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e

export CGO_ENABLED=1
export GOOS=$1
export GOARCH=$2
export GOARM=7
ext=$3
date=$(date +'%Y%m%d')
version=${CIRCLE_BUILD_NUM-$date}
tag=v$version
echo $tag-$GOOS-$GOARCH
go build -ldflags="-s -w -X main.Version=$tag" -o ./bin/mantle-$tag-$GOOS-$GOARCH$ext

0 comments on commit 83bae88

Please sign in to comment.