This release introduces a new approach to environment variable management in the DPF project. The changes improve maintainability, reduce duplication, and provide a more consistent way to handle configuration across all scripts.
- Created a new
.envfile that contains all environment variables with their default values - Organized variables into logical sections with clear comments
- Removed redundant variable definitions from the Makefile
- Added
scripts/env.shto handle environment variable loading - Implemented robust error handling for missing
.envfile - Added support for comments and empty lines in the
.envfile - Properly handles quoted values in the environment file
- Removed all environment variable definitions from the Makefile
- Maintained the
include .envdirective to ensure Make has access to variables - Kept all targets and help documentation intact
- Modified scripts to source the environment variables from
env.sh - Used
$(dirname "$0")/env.shto ensure scripts can find the environment file regardless of where they're called from - Maintained backward compatibility with existing script functionality
- Improved Maintainability: Environment variables are now defined in a single location
- Better Organization: Variables are grouped by functionality with clear comments
- Enhanced Flexibility: Scripts can source environment variables when needed
- Reduced Duplication: Eliminated redundant variable definitions
- Consistent Configuration: All scripts now use the same environment loading mechanism
To use the new environment variable system in your scripts:
#!/bin/bash
# Exit on error
set -e
# Source environment variables
source "$(dirname "$0")/env.sh"
# Your script logic hereNo migration steps are required for existing scripts. The changes are backward compatible, and all existing functionality continues to work as before.
None.
- Consider adding validation for required environment variables
- Add support for environment-specific configuration files (e.g.,
.env.development,.env.production) - Implement a mechanism to override environment variables via command-line arguments