-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·50 lines (41 loc) · 1.09 KB
/
install.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.09 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
#!/bin/bash
echo "Installing Cloud CLI..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "Error: Node.js is required but not installed."
echo "Visit: https://nodejs.org/"
exit 1
fi
# Check if npm is installed
if ! command -v npm &> /dev/null; then
echo "Error: npm is required but not installed."
exit 1
fi
# Install dependencies
echo "Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "Failed to install dependencies"
exit 1
fi
# Make the script executable
chmod +x index.js
# Link globally
echo "Linking CLI globally..."
npm link
if [ $? -ne 0 ]; then
echo "Failed to link CLI globally. You may need to run with sudo:"
echo "sudo npm link"
exit 1
fi
echo "Cloud CLI installed successfully!"
echo ""
echo "Usage:"
echo " cloud help Show help"
echo " cloud ./Dockerfile Ship a local container"
echo " cloud nginx:alpine Ship a remote image"
echo ""
echo "Example:"
echo " cloud nginx:alpine --ship --name my-app"
echo ""
echo "Ready to deploy containers to the cloud."