-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
9 changed files
with
117 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
#!/bin/bash | ||
|
||
ver=`cat server/base/app_ver.go | grep "APP_VER" | awk '{print $3}' | sed 's/"//g'` | ||
ver=$(cat version) | ||
echo $ver | ||
|
||
#docker login -u bjdgyc | ||
# docker login -u bjdgyc | ||
|
||
#docker build -t bjdgyc/anylink . | ||
# docker build -t bjdgyc/anylink -f docker/Dockerfile . | ||
|
||
docker build -t bjdgyc/anylink --build-arg GitCommitId=$(git rev-parse HEAD) -f docker/Dockerfile . | ||
docker build -t bjdgyc/anylink --progress=plain --build-arg CN="yes" --build-arg appVer=$ver \ | ||
--build-arg commitId=$(git rev-parse HEAD) --build-arg buildDate=$(date --iso-8601=seconds) \ | ||
-f docker/Dockerfile . | ||
|
||
docker tag bjdgyc/anylink:latest bjdgyc/anylink:$ver | ||
|
||
exit 0 | ||
|
||
docker push bjdgyc/anylink:$ver | ||
docker push bjdgyc/anylink:latest | ||
|
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,19 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
|
||
#TODO 本地打包时使用镜像 | ||
if [[ $CN == "yes" ]]; then | ||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories | ||
export GOPROXY=https://goproxy.cn | ||
fi | ||
|
||
#apk add gcc musl-dev | ||
|
||
cd /anylink | ||
|
||
go mod tidy | ||
go build -o anylink -trimpath \ | ||
-ldflags "-s -w -extldflags '-static' -X main.appVer=$appVer -X main.commitId=$commitId -X main.buildDate=$buildDate" | ||
|
||
/anylink/anylink -v |
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 |
---|---|---|
|
@@ -8,6 +8,6 @@ var ( | |
// APP_VER app版本号 | ||
APP_VER = "0.0.1" | ||
// 提交id | ||
CommitId string | ||
Date string | ||
CommitId string | ||
BuildDate string | ||
) |
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 +1 @@ | ||
0.10.3 | ||
0.10.3-test |