-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path7.BuildPlugin.sh
More file actions
executable file
·45 lines (35 loc) · 1.36 KB
/
7.BuildPlugin.sh
File metadata and controls
executable file
·45 lines (35 loc) · 1.36 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
#!/bin/sh
echo "======================================"
echo " Step 1: Installing Plugin Dependencies"
echo "======================================"
# Step 2: Install contracts dependencies
echo "1. Installing contracts dependencies..."
cd contracts && pnpm i
check_status $? "Contracts dependencies installation"
cd ..
# Step 3: Build Go modules
echo "2. Building Go modules..."
go mod tidy
check_status $? "Go modules build"
# Step 4: Install Operator UI
echo "3. Installing Operator UI..."
go run operator_ui/install.go .
check_status $? "Operator UI installation"
# Step 5: Build Plugin binary
PLUGIN_BINARY_VERSION="2.4.0"
PLUGIN_BINARY_SHA="b1245c440825ebbb342c9bfa1b0cfa9da54dae53"
echo "4. Building Plugin binary..."
go build -ldflags "-X github.com/goplugin/pluginv3.0/v2/core/static.Version=$PLUGIN_BINARY_VERSION -X github.com/goplugin/pluginv3.0/v2/core/static.Sha=$PLUGIN_BINARY_SHA" -o plugin
check_status $? "Plugin binary build"
# Step 6: Move binary to Go bin folder
echo "5. Moving Plugin binary to Go bin folder..."
GOP=$(grep 'GOPATH=' ~/.profile | cut -d '=' -f 2)
if [ -z "$GOP" ]; then
echo "Error: GOPATH is not set in ~/.profile. Exiting."
exit 1
fi
mv plugin "$GOP/bin/"
check_status $? "Binary move"
echo "======================================"
echo "✅ Plugin Dependencies Installed Successfully!"
echo "======================================"