-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·38 lines (30 loc) · 1 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
: ${WFSM_TAG:="0.1.0"}
: ${WFSM_ARCH:=$(arch)}
: ${WFSM_OS:=$(echo $(uname -s) | tr '[:upper:]' '[:lower:]')}
: ${WFSM_TARGET:=${HOME}/.wfsm/bin}
WFSM_ARCHIVE_URL="https://github.com/agntcy/workflow-srv-mgr/releases/download/v${WFSM_TAG}/wfsm${WFSM_TAG}_${WFSM_OS}_${WFSM_ARCH}.tar.gz"
echo "Installing the Workflow Server Manager tool:"
echo ""
echo "OS:" "$WFSM_OS"
echo "ARCH:" "$WFSM_ARCH"
echo "AG:" "$WFSM_TAG"
echo "TARGET:" "$WFSM_TARGET"
echo "ARCHIVE_URL:" "$WFSM_ARCHIVE_URL"
echo ""
echo ""
set -e
rm -f "$WFSM_TARGET/wfsm"
# Create the target directory if it doesn't exist
mkdir -p "$WFSM_TARGET"
# Check if the version exists
if ! curl --head --fail --output /dev/null "$WFSM_ARCHIVE_URL" 2> /dev/null;
then
echo "Version not found"
exit 1
fi
# Download and extract the archive
curl -s -S -L "$WFSM_ARCHIVE_URL" | tar -xf - -C "$WFSM_TARGET"
# Make the binary executable
chmod +x "$WFSM_TARGET/wfsm"
Echo "Installation complete. The 'wfsm' binary is located at $WFSM_TARGET/wfsm"