Utility scripts for development, deployment, and maintenance.
Sets up the development environment.
./scripts/setup-dev.shWhat it does:
- Checks prerequisites (Go, Docker, etc.)
- Installs development tools
- Downloads dependencies
- Creates necessary directories
- Builds components
Cleans build artifacts and temporary files.
./scripts/clean.shWhat it does:
- Removes build artifacts (
bin/,dist/) - Cleans Go cache
- Removes Docker containers and volumes
- Cleans test artifacts
Validates configuration files.
./scripts/validate-config.shRequirements:
yamllint(install withpip install yamllint)
What it does:
- Validates YAML syntax
- Checks configuration structure
Generates API documentation from code.
./scripts/generate-docs.shRequirements:
godoc(install withgo install golang.org/x/tools/cmd/godoc@latest)protoc-gen-doc(optional, for proto documentation)
What it does:
- Generates Go API documentation
- Generates protocol buffer documentation
Checks the health of DeCube services.
./scripts/health-check.shEnvironment variables:
CATALOG_ENDPOINT: Catalog service endpoint (default: http://localhost:8080)GOSSIP_ENDPOINT: Gossip service endpoint (default: http://localhost:8000)CAS_ENDPOINT: CAS service endpoint (default: http://localhost:9000)
What it does:
- Checks Docker status
- Verifies service health endpoints
- Checks port usage
Builds release binaries for multiple platforms.
./scripts/build-release.sh [version]What it does:
- Builds binaries for Linux, macOS, and Windows
- Creates checksums
- Outputs to
dist/directory
On Unix-like systems:
chmod +x scripts/*.shWhen adding new scripts:
- Place them in the
scripts/directory - Make them executable
- Add a shebang (
#!/bin/bash) - Include error handling (
set -e) - Document in this README
- Follow existing script patterns
- Use
set -efor error handling - Provide clear output messages
- Check prerequisites before running
- Use colors for better readability (optional)
- Include help/usage information
- Handle edge cases gracefully
- Ensure it's executable:
chmod +x scripts/script-name.sh - Check shebang is correct:
#!/bin/bash - Verify line endings are Unix-style (LF, not CRLF)
- Run
chmod +x scripts/script-name.sh - Or run with
bash scripts/script-name.sh
- Remove
set -etemporarily to see errors - Add
set -xfor debug output - Check script output carefully