Files
fleet/tools/tuf/test/load_orbit_version_vars.sh
Lucas Manuel Rodriguez 99d9a6b54e Allow disabling the dirty check for development (#38163)
We (I) forgot that executables for development of Fleet Desktop will
always be dirty :)
2026-01-14 09:28:37 -03:00

24 lines
882 B
Bash

#!/bin/bash
# Constraints for orbit versioning:
# - WiX fails with "Z:\wix\main.wxs(3): error CNDL0242 : Invalid product version '10.250525.0913'. Product version
# must have a major version less than 256, a minor version less than 256, and a build version less than 65536."
# - Cannot use "-build", WiX/Windows prefers three dots X.Y.Z.P format.
# - Must be with three parts X.Y.Z (otherwise breaks orbit semantic versioning)
ORBIT_MAJOR=$(date +"%-y") # year
ORBIT_MINOR=$(date +"%-m") # month
day=$(date +"%-d")
hour=$(date +"%-H")
minute=$(date +"%-M")
ORBIT_PATCH=$(( (day << 11) | (hour << 6) | minute )) # must fit into 16-bit number
ORBIT_VERSION="$ORBIT_MAJOR.$ORBIT_MINOR.$ORBIT_PATCH"
ORBIT_COMMIT=$(git rev-parse HEAD)
DISABLE_DIRTY_CHECK=1
export ORBIT_MAJOR
export ORBIT_MINOR
export ORBIT_PATCH
export ORBIT_VERSION
export ORBIT_COMMIT
export DISABLE_DIRTY_CHECK