Files
pentagi/scripts/version.ps1
T
Dmitry Ng 9a63aa7516 feat: enhance Docker build process with versioning and entrypoint script
- Added build arguments for version information in the Dockerfile, allowing the embedding of package version and revision during the build.
- Updated the build commands for backend utilities to include versioning flags, improving traceability of builds.
- Introduced a new entrypoint script to manage SSL certificate generation, enhancing security setup for the service.
- Updated README with instructions for using the new versioning scripts for Docker builds, improving user guidance.
- Added versioning scripts for Linux/macOS and Windows to streamline the build process and ensure consistent versioning across environments.

These changes improve the build process by integrating version control and enhancing the security setup for the application.
2026-02-25 18:28:54 +03:00

45 lines
1.4 KiB
PowerShell

# Source this file to set version environment variables
# Usage: . .\scripts\version.ps1
# Get the latest git tag as version
$latestTag = git describe --tags --abbrev=0 2>$null
if (-not $latestTag) {
$latestTag = "v0.0.0"
}
$env:PACKAGE_VER = $latestTag.TrimStart('v')
# Get current commit hash
$currentCommit = git rev-parse HEAD 2>$null
# Get commit hash of the latest tag
$tagCommit = git rev-list -n 1 $latestTag 2>$null
# Set revision only if current commit differs from tag commit
if ($currentCommit -and ($currentCommit -ne $tagCommit)) {
$env:PACKAGE_REV = git rev-parse --short HEAD
$buildType = "development"
$fullVersion = "$env:PACKAGE_VER-$env:PACKAGE_REV"
} else {
$env:PACKAGE_REV = ""
$buildType = "release"
$fullVersion = $env:PACKAGE_VER
}
# Print version information
Write-Host "======================================"
Write-Host "PentAGI Build Version"
Write-Host "======================================"
Write-Host "PACKAGE_VER: $env:PACKAGE_VER"
if ($env:PACKAGE_REV) {
Write-Host "PACKAGE_REV: $env:PACKAGE_REV ($buildType)"
} else {
Write-Host "PACKAGE_REV: ($buildType)"
}
Write-Host "Full version: $fullVersion"
Write-Host "======================================"
Write-Host ""
Write-Host "Environment variables exported:"
Write-Host " `$env:PACKAGE_VER = $env:PACKAGE_VER"
Write-Host " `$env:PACKAGE_REV = $env:PACKAGE_REV"
Write-Host ""