parent
0fcbb08e84
commit
155252b444
@ -0,0 +1 @@
|
||||
v0.4.15
|
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
GO_VERSION=$(go version | awk '{for(i=1; i<NF; i++){if($i ~ /^go[0-9]/){sub(/go/,"",$i);print $i}}}')
|
||||
|
||||
VERSION=$(cat ./VERSION)
|
||||
[ -z "$GO_VERSION" ] && { echo "variable GO_VERSION is not set!"; exit 1; }
|
||||
[ -z "$VERSION" ] && { echo "variable VERSION is not set!"; exit 1; }
|
||||
|
||||
echo "VERSION $VERSION"
|
||||
echo "GO_VERSION $GO_VERSION"
|
||||
|
||||
BRANCH=$VERSION
|
||||
VERSION=$(echo "$VERSION" | sed 's/v//')
|
||||
SPEC_FILE=$(ls *.spec | head -n 1)
|
||||
sed -i "s/Version.*$/Version: ${VERSION}/1" $SPEC_FILE
|
||||
|
||||
sudo rm -rf ./source || exit 1
|
||||
mkdir ./source
|
||||
pushd ./source >/dev/null || exit 1
|
||||
git clone --branch $BRANCH https://github.com/goodwithtech/dockle.git
|
||||
pushd ./dockle >/dev/null || exit 1
|
||||
sed -Ei "s/go\s+[0-9]+.*$/go ${GO_VERSION}/1" go.mod
|
||||
export GOPATH=${PWD}/mod
|
||||
go mod tidy
|
||||
rm -rf ./.github
|
||||
rm -rf ./.git
|
||||
rm -rf ./.vex
|
||||
popd >/dev/null
|
||||
|
||||
mv ./dockle ./dockle-$VERSION
|
||||
tar -cvaf dockle-${VERSION}.tar.xz dockle-$VERSION || exit 1
|
||||
mv dockle-${VERSION}.tar.xz ./..
|
||||
popd >/dev/null
|
||||
sudo rm -rf ./source
|
||||
|
Loading…
Reference in new issue