优化Dockerfile使用

This commit is contained in:
bjdgyc
2021-04-09 14:49:41 +08:00
parent 9b509c33f3
commit d8eb8ab7ed
8 changed files with 201 additions and 48 deletions

View File

@@ -1,4 +1,13 @@
#!/usr/bin/env bash
#!/bin/env bash
set -x
function RETVAL(){
rt=$1
if [ $rt != 0 ]; then
echo $rt
exit 1
fi
}
#当前目录
cpath=$(pwd)
@@ -6,6 +15,7 @@ cpath=$(pwd)
echo "编译二进制文件"
cd $cpath/server
go build -o anylink -ldflags "-X main.COMMIT_ID=$(git rev-parse HEAD)"
RETVAL $?
echo "编译前端项目"
cd $cpath/web
@@ -14,6 +24,7 @@ npm install --registry=https://registry.npm.taobao.org
npm run build --registry=https://registry.npm.taobao.org
#npm install
#npm run build
RETVAL $?
cd $cpath