57 líneas
1.7 KiB
Bash
Archivo Ejecutable
57 líneas
1.7 KiB
Bash
Archivo Ejecutable
#!/bin/bash
|
|
|
|
# Installation script for Buque
|
|
|
|
set -e
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
echo -e "${GREEN}=== Buque Installation Script ===${NC}\n"
|
|
|
|
# Check if Go is installed
|
|
if ! command -v go &> /dev/null; then
|
|
echo -e "${RED}Error: Go is not installed${NC}"
|
|
echo "Please install Go 1.21 or higher from https://golang.org/dl/"
|
|
exit 1
|
|
fi
|
|
|
|
GO_VERSION=$(go version | awk '{print $3}' | sed 's/go//')
|
|
echo -e "${GREEN}✓${NC} Go version: $GO_VERSION"
|
|
|
|
# Check if Docker is installed
|
|
if ! command -v docker &> /dev/null; then
|
|
echo -e "${YELLOW}Warning: Docker is not installed${NC}"
|
|
echo "Buque requires Docker to function. Please install Docker from https://docs.docker.com/get-docker/"
|
|
fi
|
|
|
|
# Check if Docker Compose is available
|
|
if docker compose version &> /dev/null; then
|
|
COMPOSE_VERSION=$(docker compose version | awk '{print $4}')
|
|
echo -e "${GREEN}✓${NC} Docker Compose version: $COMPOSE_VERSION"
|
|
elif command -v docker-compose &> /dev/null; then
|
|
COMPOSE_VERSION=$(docker-compose version --short)
|
|
echo -e "${GREEN}✓${NC} Docker Compose version: $COMPOSE_VERSION"
|
|
else
|
|
echo -e "${YELLOW}Warning: Docker Compose is not installed${NC}"
|
|
fi
|
|
|
|
# Build and install
|
|
echo -e "\n${GREEN}Building Buque...${NC}"
|
|
make install
|
|
|
|
# Verify installation
|
|
if command -v buque &> /dev/null; then
|
|
echo -e "\n${GREEN}✓ Buque installed successfully!${NC}"
|
|
echo -e "\nVersion: $(buque --version)"
|
|
echo -e "\nRun 'buque init' to get started"
|
|
else
|
|
echo -e "\n${YELLOW}Installation completed but 'buque' command not found in PATH${NC}"
|
|
echo "Make sure \$GOPATH/bin is in your PATH"
|
|
echo "Add this to your .bashrc or .zshrc:"
|
|
echo " export PATH=\$PATH:\$(go env GOPATH)/bin"
|
|
fi
|