Created
February 2, 2025 13:17
-
-
Save karubits/600da374f534d8828de49c33815bdc1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Detect architecture | |
ARCH=$(uname -m) | |
if [[ "$ARCH" == "x86_64" ]]; then | |
ARCH="amd64" | |
elif [[ "$ARCH" == "aarch64" ]]; then | |
ARCH="arm64"\elif [[ "$ARCH" == "armv7l" ]]; then | |
ARCH="arm"\else | |
echo "Unsupported architecture: $ARCH" | |
exit 1 | |
fi | |
# Get the latest release version | |
LATEST_VERSION=$(curl -s https://api.github.com/repos/semaphoreui/semaphore/releases/latest | grep 'tag_name' | cut -d '"' -f 4) | |
if [[ -z "$LATEST_VERSION" ]]; then | |
echo "Failed to retrieve the latest version. Exiting." | |
exit 1 | |
fi | |
echo "Latest version found: $LATEST_VERSION" | |
# Construct download URL | |
DEB_PACKAGE="semaphore_${LATEST_VERSION#v}_linux_${ARCH}.deb" | |
DOWNLOAD_URL="https://github.com/semaphoreui/semaphore/releases/download/$LATEST_VERSION/$DEB_PACKAGE" | |
echo "Downloading $DEB_PACKAGE ..." | |
wget -q --show-progress "$DOWNLOAD_URL" -O "$DEB_PACKAGE" | |
# Install package | |
echo "Installing $DEB_PACKAGE ..." | |
sudo dpkg -i "$DEB_PACKAGE" | |
# Cleanup | |
rm "$DEB_PACKAGE" | |
# Run initial setup | |
echo "Running Semaphore setup ..." | |
semaphore setup | |
echo "Installation complete!" | |
echo "To start Semaphore, run:" | |
echo " semaphore server --config=./config.json" | |
echo "Semaphore will be available at: https://localhost:3000" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment