-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·86 lines (70 loc) · 3.1 KB
/
install.sh
File metadata and controls
executable file
·86 lines (70 loc) · 3.1 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
# Variables
VIBE_KANBAN_VERSION="${VERSION:-"latest"}"
set -euo pipefail
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# Clean up
rm -rf /var/lib/apt/lists/*
# Checks if packages are installed and installs them if not
check_packages() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
echo "Running apt-get update..."
apt-get update -y
fi
apt-get -y install --no-install-recommends "$@"
fi
}
# Make sure we have curl and ca-certificates
check_packages curl ca-certificates
# Update CA certificates to ensure SSL works properly
update-ca-certificates
echo "Installing Vibe Kanban version: $VIBE_KANBAN_VERSION"
# Check if node and npm are available
if ! command -v node >/dev/null 2>&1 || ! command -v npm >/dev/null 2>&1; then
echo "Node.js and npm are required but not found. Installing Node.js..."
# Install Node.js and npm using official Ubuntu packages
check_packages nodejs npm
# Verify installation
if ! command -v node >/dev/null 2>&1 || ! command -v npm >/dev/null 2>&1; then
echo "ERROR: Failed to install Node.js and npm"
exit 1
fi
fi
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
# Install vibe-kanban globally
# Note: In some Docker build environments, SSL certificate chains may be incomplete.
# We try with SSL verification first, and only fall back to --strict-ssl=false if needed.
# This fallback is common in Docker build contexts and is acceptable for trusted registries like npmjs.org.
if [ "$VIBE_KANBAN_VERSION" = "latest" ]; then
echo "Installing latest version of vibe-kanban..."
if ! npm install -g vibe-kanban; then
echo "WARNING: SSL verification failed. Retrying with --strict-ssl=false..."
echo "This is common in Docker build environments. The package is being downloaded from the trusted npmjs.org registry."
npm install -g vibe-kanban --strict-ssl=false
fi
else
echo "Installing vibe-kanban version $VIBE_KANBAN_VERSION..."
if ! npm install -g vibe-kanban@"$VIBE_KANBAN_VERSION"; then
echo "WARNING: SSL verification failed. Retrying with --strict-ssl=false..."
echo "This is common in Docker build environments. The package is being downloaded from the trusted npmjs.org registry."
npm install -g vibe-kanban@"$VIBE_KANBAN_VERSION" --strict-ssl=false
fi
fi
# Clean up
rm -rf /var/lib/apt/lists/*
# Verify installation
echo "Verifying installation..."
if command -v vibe-kanban >/dev/null 2>&1; then
# Try to get version, but don't fail if it requires network access
vibe-kanban --version 2>&1 || echo "vibe-kanban command is available (version check may require network)"
echo "Vibe Kanban installation completed successfully!"
else
echo "Warning: vibe-kanban command not found in PATH. This might be expected if npm global bin is not in PATH."
echo "Vibe Kanban has been installed via npm."
fi
echo "Done!"