fixing dist output and trying an install.sh
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
444059c210
commit
7e640a84b8
|
|
@ -0,0 +1,2 @@
|
|||
diffs
|
||||
build_logs
|
||||
6
build.sh
6
build.sh
|
|
@ -14,9 +14,9 @@ prepare_build() {
|
|||
build_binary() {
|
||||
local os=$1
|
||||
local arch=$2
|
||||
local output_main="dist/${os}_${arch}_main"
|
||||
local output_filter="dist/${os}_${arch}_filter"
|
||||
local output_api="dist/${os}_${arch}_api"
|
||||
local output_main="dist/${PROJECT_NAME}_${os}_${arch}_main"
|
||||
local output_filter="dist/${PROJECT_NAME}_${os}_${arch}_filter"
|
||||
local output_api="dist/${PROJECT_NAME}_${os}_${arch}_api"
|
||||
|
||||
env GOOS=$os GOARCH=$arch go build -o $output_main main.go &> "build_logs/${os}_${arch}_main.log"
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28
install.sh
28
install.sh
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
INSTALL_DIR="/usr/local/bin"
|
||||
BINARY_NAME="oculus"
|
||||
PROJECT_NAME=$(basename "$(pwd)")
|
||||
BASE_URL="https://git.nixc.us/colin/Oculus/raw/branch/main/dist"
|
||||
|
||||
# Supported architectures
|
||||
|
|
@ -17,17 +17,21 @@ case $ARCH in
|
|||
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
|
||||
esac
|
||||
|
||||
BINARY_URL="${BASE_URL}/oculus_${OS}_${ARCH}"
|
||||
COMPONENTS=("filter" "api" "main")
|
||||
|
||||
echo "Downloading and installing $BINARY_NAME from $BINARY_URL..."
|
||||
for COMPONENT in "${COMPONENTS[@]}"; do
|
||||
BINARY_NAME="${PROJECT_NAME}_${COMPONENT}"
|
||||
BINARY_URL="${BASE_URL}/${PROJECT_NAME}_${OS}_${ARCH}_${COMPONENT}"
|
||||
echo "Downloading and installing $BINARY_NAME from $BINARY_URL..."
|
||||
|
||||
# Check if we have write permission to the install directory
|
||||
if [ -w "${INSTALL_DIR}" ]; then
|
||||
curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
else
|
||||
sudo curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
fi
|
||||
# Check if we have write permission to the install directory
|
||||
if [ -w "${INSTALL_DIR}" ]; then
|
||||
curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
else
|
||||
sudo curl -sSL "$BINARY_URL" -o "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
sudo chmod +x "${INSTALL_DIR}/${BINARY_NAME}"
|
||||
fi
|
||||
|
||||
echo "Installed $BINARY_NAME to $INSTALL_DIR"
|
||||
echo "Installed $BINARY_NAME to $INSTALL_DIR"
|
||||
done
|
||||
|
|
|
|||
Loading…
Reference in New Issue