-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·81 lines (69 loc) · 2.29 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·81 lines (69 loc) · 2.29 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
#!/bin/bash
git pull
# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check and install Homebrew if not available
if ! command_exists brew; then
echo "Homebrew is not installed. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Check and install Go if not available
if ! command_exists go; then
echo "Go is not installed. Installing..."
if command_exists brew; then
brew install go
elif command_exists apt-get; then
sudo apt-get install -y golang
elif command_exists yum; then
sudo yum install -y golang
else
echo "Unsupported package manager. Please install Go manually."
exit 1
fi
fi
# Check and install Mage if not available
if ! command_exists mage; then
echo "Mage is not installed. Installing..."
go install github.com/magefile/mage@latest
fi
# Check and install npm if not available
if ! command_exists npm; then
echo "npm is not installed. Installing..."
if command_exists brew; then
brew install npm
elif command_exists apt-get; then
sudo apt-get install -y npm
elif command_exists yum; then
sudo yum install -y npm
else
echo "Unsupported package manager. Please install npm manually."
exit 1
fi
fi
# Execute mage command
mage -v
npm install
# Execute npm run build
npm run build
# Check and install Docker Compose if not available
if ! command_exists docker-compose; then
echo "Docker Compose is not installed. Installing..."
if command_exists brew; then
brew install docker-compose
elif command_exists apt-get; then
sudo apt-get install -y docker-compose
elif command_exists yum; then
sudo yum install -y docker-compose
else
echo "Unsupported package manager. Please install Docker Compose manually."
exit 1
fi
fi
# Export GRAFANA_ACCESS_POLICY_TOKEN
export GRAFANA_ACCESS_POLICY_TOKEN=glc_eyJvIjoiNjQyNjM1IiwibiI6InBsdWdpbi1zaWduaW5nLXBsdWdpbi1zaWduaW5nLXRva2VuIiwiayI6IkkyNXk1QklOVUM4MTVEOE5RejNHR3g5OCIsIm0iOnsiciI6InVzIn19
# Execute npx @grafana/sign-plugin
npx @grafana/sign-plugin@latest --rootUrls http://localhost:3000
# Run Docker Compose
docker-compose up -d && docker compose restart