'Generic Commit'
This commit is contained in:
18
publish.sh
18
publish.sh
@@ -3,6 +3,9 @@
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
ARCH=$(uname -m)
|
||||
TEMP_DIR="${SCRIPT_DIR}/temp"
|
||||
SOS="${TEMP_DIR}/sos"
|
||||
|
||||
echo "Publishing simple-object-server to gitea.jde.nz/public/simple-object-server:latest"
|
||||
|
||||
@@ -13,10 +16,11 @@ function die() {
|
||||
|
||||
[[ -n $SOS_WRITE_TOKEN ]] || die "SOS_WRITE_TOKEN not specified"
|
||||
|
||||
|
||||
# clear output dir
|
||||
rm -rf "${SCRIPT_DIR}/output"
|
||||
mkdir -p "${SCRIPT_DIR}/output"
|
||||
|
||||
# build release version
|
||||
export CMAKE_BUILD_TYPE="Release"
|
||||
export PROJECT="simple-object-server"
|
||||
|
||||
@@ -30,18 +34,12 @@ docker build \
|
||||
|
||||
[ -f ${SCRIPT_DIR}/output/simple-object-server ] || die "Build failed."
|
||||
|
||||
# uplaod to getbin.xyz
|
||||
|
||||
# # download the sos binary
|
||||
SOS="${SCRIPT_DIR}/temp/sos"
|
||||
mkdir -p "${SCRIPT_DIR}/temp"
|
||||
trap 'rm -rf "${SCRIPT_DIR}/temp"' EXIT
|
||||
|
||||
# download the sos binary
|
||||
mkdir -p "${TEMP_DIR}"
|
||||
trap 'rm -rf "${TEMP_DIR}"' EXIT
|
||||
curl -L -o "${SOS}" "https://getbin.xyz/sos"
|
||||
chmod +x "${SOS}"
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
# upload arch-specific binary
|
||||
"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:latest-${ARCH}"
|
||||
|
||||
|
Reference in New Issue
Block a user