This downloads and installs dependencies necessary to run or develop. Add docker-compose.yml for initial use
67 lines
1.8 KiB
Bash
Executable File
67 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Note: This is kind of AI slop and needs to be more carefully reviewed.
|
|
|
|
set -eu
|
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# shellcheck source=framework/versions
|
|
source "$DIR/framework/versions"
|
|
|
|
# Ensure correct node version is installed
|
|
node_installed_checksum_file="$DIR/framework/binaries/.node.checksum"
|
|
node_installed_checksum=""
|
|
if [ -f "$node_installed_checksum_file" ]; then
|
|
node_installed_checksum=$(cat "$node_installed_checksum_file")
|
|
fi
|
|
|
|
if [ "$node_installed_checksum" != "$nodejs_checksum_linux_x86_64" ]; then
|
|
echo "Downloading Node.js..."
|
|
node_archive="$DIR/framework/downloads/node.tar.xz"
|
|
curl -fsSL "$nodejs_binary_linux_x86_64" -o "$node_archive"
|
|
|
|
echo "Verifying checksum..."
|
|
echo "$nodejs_checksum_linux_x86_64 $node_archive" | sha256sum -c -
|
|
|
|
echo "Extracting Node.js..."
|
|
tar -xf "$node_archive" -C "$DIR/framework/binaries"
|
|
rm "$node_archive"
|
|
|
|
echo "$nodejs_checksum_linux_x86_64" >"$node_installed_checksum_file"
|
|
fi
|
|
|
|
# Ensure correct pnpm version is installed
|
|
pnpm_binary="$DIR/framework/binaries/pnpm"
|
|
pnpm_installed_checksum_file="$DIR/framework/binaries/.pnpm.checksum"
|
|
pnpm_installed_checksum=""
|
|
if [ -f "$pnpm_installed_checksum_file" ]; then
|
|
pnpm_installed_checksum=$(cat "$pnpm_installed_checksum_file")
|
|
fi
|
|
|
|
# pnpm checksum includes "sha256:" prefix, strip it for sha256sum
|
|
pnpm_checksum="${pnpm_checksum_linux_x86_64#sha256:}"
|
|
|
|
if [ "$pnpm_installed_checksum" != "$pnpm_checksum" ]; then
|
|
echo "Downloading pnpm..."
|
|
curl -fsSL "$pnpm_binary_linux_x86_64" -o "$pnpm_binary"
|
|
|
|
echo "Verifying checksum..."
|
|
echo "$pnpm_checksum $pnpm_binary" | sha256sum -c -
|
|
|
|
chmod +x "$pnpm_binary"
|
|
|
|
echo "$pnpm_checksum" >"$pnpm_installed_checksum_file"
|
|
fi
|
|
|
|
# Get golang binaries in place
|
|
cd "$DIR/master"
|
|
go build
|
|
|
|
cd "$DIR/logger"
|
|
go build
|
|
|
|
# Update framework code
|
|
cd "$DIR/express"
|
|
../cmd pnpm install
|