atxtechbro / atxtechbro/dotfiles
Automate Google Cloud CLI installation and updates in setup.sh
- Dominant language
- Shell
- Stars
- 27
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
## Overview
Add automated installation and update functionality for Google Cloud CLI (gcloud) in setup.sh, similar to how we currently handle GitHub CLI.
## Current Behavior
- Google Cloud CLI must be manually installed and updated
- No consistent installation process across different machines
- Doesn't follow our "spilled coffee" principle for reproducibility
- Telemetry is enabled by default, sending usage data to Google
## Desired Behavior
- Detect if gcloud is installed, and install if missing
- Check for updates and apply them automatically during setup
- Follow the same pattern used for GitHub CLI in setup.sh
- Support multiple platforms (Debian/Ubuntu, Arch, macOS)
- **Automatically disable telemetry/usage reporting**
## Implementation Details
1. Add a function to detect gcloud installation
2. Add platform-specific installation commands
3. Add update mechanism for existing installations
4. Include proper error handling and user feedback
5. **Disable telemetry collection after installation**
### Example Implementation (for Debian/Ubuntu):
```bash
# Check for gcloud and install/update if needed
if ! command -v gcloud &> /dev/null; then
echo "Installing Google Cloud CLI..."
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install -y google-cloud-sdk
# Disable telemetry
gcloud config set disable_usage_reporting true
else
echo "Updating Google Cloud CLI..."
sudo apt-get update && sudo apt-get install -y --only-upgrade google-cloud-sdk
# Ensure telemetry remains disabled
gcloud config set disable_usage_reporting true
fi
```
## Additional Considerations
- Create a `.bash_aliases.gcloud` file for common gcloud commands and shortcuts
- Consider adding basic configuration options during setup
- Document the gcloud installation in the README.md
- Add a note about telemetry being disabled by default in our setup
## Related to
- Follows the same pattern as GitHub CLI automation
- Supports our modular shell configuration approach
- Aligns with the "spilled coffee" principle
- Respects privacy by disabling telemetry collection
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.