https://github.com/ftao1/update-packer-win64
Script to update packer on Windows
https://github.com/ftao1/update-packer-win64
packer shell windows wsl
Last synced: 2 months ago
JSON representation
Script to update packer on Windows
- Host: GitHub
- URL: https://github.com/ftao1/update-packer-win64
- Owner: ftao1
- License: mit
- Created: 2024-06-09T17:26:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T08:24:33.000Z (about 2 years ago)
- Last Synced: 2025-05-18T08:07:32.606Z (about 1 year ago)
- Topics: packer, shell, windows, wsl
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Update HashiCorp Packer on Windows
Production-ready bash script to securely update Win64 packer in WSL with comprehensive error handling, automatic backups, and integrity verification.
## Features
- **Secure Downloads**: Uses proper SSL certificate verification (no more `--no-check-certificate`)
- **Input Validation**: Validates version format and sanitizes inputs to prevent injection attacks
- **Automatic Backups**: Creates timestamped backups before updates with rollback capability
- **Integrity Verification**: SHA256 checksum verification for all downloads
- **Retry Logic**: Automatic retry with exponential backoff for network failures
- **Comprehensive Logging**: Detailed logging with timestamps to `/tmp/packer-update.log`
- **Atomic Operations**: Uses temporary directories to prevent partial installations
- **Signal Handling**: Graceful cleanup on interruption (Ctrl+C) with proper terminal color reset
- **Version Management**: Checks current version and skips if already installed
- **API Integration**: Uses HashiCorp releases API for version discovery
## Requirements
The following software must be installed in your WSL environment:
- [WSL](https://learn.microsoft.com/en-us/windows/wsl/install)
- `curl` - for secure downloads
- `unzip` - for extracting Packer archives
- `sha256sum` - for integrity verification
## Usage
$ ./update-packer-win64.sh
$ ./update-packer-win64.sh --help
## Examples
# Install specific version
$ ./update-packer-win64.sh 1.9.4
# Install beta version
$ ./update-packer-win64.sh 1.9.4-beta1
# Show current and available versions
$ ./update-packer-win64.sh
## License
MIT
## Author
These configurations are maintained by F.Tao.