23 lines
492 B
Bash
Executable file
23 lines
492 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
PACKAGE_DIR="./packages"
|
|
PACKAGE_NAME="./tixel-watch"
|
|
|
|
if [ -d "${PACKAGE_DIR}" ]; then
|
|
rm -rf "${PACKAGE_DIR:?}/"*
|
|
else
|
|
mkdir -p "${PACKAGE_DIR}"
|
|
fi
|
|
|
|
if [ -d "${PACKAGE_NAME}" ]; then
|
|
rm -rf "${PACKAGE_NAME:?}"
|
|
fi
|
|
|
|
CGO_ENABLED=0 go build -ldflags="-s -w" -o "$PACKAGE_DIR"/tixel-watch .
|
|
|
|
cp -r ./tixel-watch.service $PACKAGE_DIR/
|
|
cp -r ./configs/ $PACKAGE_DIR/
|
|
cp -r ./install.sh $PACKAGE_DIR/
|
|
mv $PACKAGE_DIR tixel-watch
|
|
|
|
tar -czvf tixel-watch.tar.gz ./tixel-watch
|