helper-scripts directory to: 1. Main helper-scripts/README.md: Updated to describe generate-release-notes.js instead of the old bash script, including new configuration options and examples. 2. helper-scripts/common/README.md: Updated to describe the JavaScript version with all its new features like configuration files, integrated/separated formats, and PR link options. 3. helper-scripts/influxdb3-monolith/RE ADME.md: Completely updated to reflect the actual JavaScript scripts present (audit-cli-documentation.js and apply-cli-patches.js) instead of the non-existent bash scripts, updated prerequisites, examples, and workflow documentation. |
||
---|---|---|
.. | ||
config | ||
lib | ||
README.md | ||
core-enterprise-config.json | ||
generate-release-notes.js | ||
generate-release-notes.md | ||
update-product-version.sh | ||
validate-tags.js |
README.md
Common Helper Scripts
This directory contains scripts that are shared across all InfluxDB documentation products.
Scripts
generate-release-notes.js
JavaScript ESM script that generates release notes by analyzing git commits between two versions across multiple repositories. Supports flexible configuration for different InfluxDB products and output formats.
Usage:
node generate-release-notes.js [options] <from_version> <to_version> [repo_paths...]
Options:
--config <file>
- Load configuration from JSON file (recommended)--format <type>
- Output format: 'integrated' or 'separated'--no-fetch
- Skip fetching latest commits from remote--pull
- Pull latest changes (use with caution)--no-pr-links
- Omit PR links from commit messages
Examples:
# Using configuration file (recommended for InfluxDB 3 Core/Enterprise)
node generate-release-notes.js --config config/influxdb3-core-enterprise.json v3.1.0 v3.2.0
# Using configuration file for other products
node generate-release-notes.js --config config/influxdb3-clustered.json v1.0.0 v1.1.0
# Traditional command-line arguments
node generate-release-notes.js v3.1.0 v3.2.0 ~/repos/influxdb ~/repos/influxdb_pro
# Skip fetch for faster local testing
node generate-release-notes.js --no-fetch v3.1.0 v3.2.0 ~/repos/influxdb
Configuration Files:
config/influxdb3-core-enterprise.json
- InfluxDB 3 Core/Enterprise separated formatconfig/influxdb3-clustered.json
- InfluxDB 3 Clustered integrated formatconfig/influxdb-v2.json
- InfluxDB v2.x integrated format
Output:
- Creates
release-notes-<version>.md
in../output/release-notes/
- Supports two formats:
- Integrated: All repositories' changes combined in unified sections
- Separated: Primary repository first, then secondary repositories (ideal for Core/Enterprise)
- Includes sections for Features, Bug Fixes, Breaking Changes, Performance, and API changes
- Automatically links to GitHub pull requests (configurable per repository)
update-product-version.sh
Updates product version information in documentation configuration files.
Usage:
./update-product-version.sh --product <product> --version <version>
Supported Products:
core
- InfluxDB 3 Coreenterprise
- InfluxDB 3 Enterpriseclustered
- InfluxDB 3 Clusteredcloud-dedicated
- InfluxDB 3 Cloud Dedicatedcloud-serverless
- InfluxDB Cloud Serverless
Example:
# Update Core to version 3.2.1
./update-product-version.sh --product core --version 3.2.1
# Update Clustered to version 2024.1
./update-product-version.sh --product clustered --version 2024.1
What it updates:
data/products.yml
- Main product version configuration- Docker Compose example files
- Installation instructions
- Download links
Library Functions
lib/docker-utils.sh
Shared Docker utility functions used by other scripts.
Available Functions:
check_docker_running()
- Verify Docker daemon is runningcontainer_exists()
- Check if a container existscontainer_running()
- Check if a container is runningpull_image()
- Pull Docker image with retry logicload_auth_token()
- Load authentication tokens from secret files
Usage in scripts:
source "$(dirname "$0")/../common/lib/docker-utils.sh"
if container_running "influxdb3-core"; then
echo "Container is running"
fi
Integration with GitHub Actions
These scripts are designed to work in both local development and CI/CD environments:
Local Development:
- Assumes Docker Desktop or Docker Engine installed
- Uses local file paths for repositories
- Can work with running containers
GitHub Actions:
- Automatically detects CI environment
- Uses workspace paths
- Handles authentication via secrets
Best Practices
- Error Handling: All scripts use
set -e
to exit on errors - Logging: Color-coded output for better readability
- Validation: Input validation before processing
- Idempotency: Scripts can be run multiple times safely
- Documentation: Comprehensive help text in each script
Adding New Common Scripts
When adding scripts to this directory:
- Ensure they are truly product-agnostic
- Follow existing naming conventions
- Add comprehensive documentation
- Include error handling and validation
- Update this README
- Test with all supported products