Skip to content

Commit

Permalink
ci: create site-version in build-meta
Browse files Browse the repository at this point in the history
This adds a new output to the build-meta step which generates a custom
site-version for use with Gluon.

Signed-off-by: David Bauer <[email protected]>
  • Loading branch information
blocktrron committed Dec 25, 2023
1 parent 06b5b83 commit 9794ac3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/build-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ SCRIPT_DIR="$(dirname "$0")"
# Get Git short hash for repo at $SCRIPT_DIR
GIT_SHORT_HASH="$(git -C "$SCRIPT_DIR" rev-parse --short HEAD)"

# Get date of last Git commit for repo at $SCRIPT_DIR
GIT_COMMIT_DATE="$(git -C "$SCRIPT_DIR" log -1 --format=%cd --date=format:'%Y%m%d')"

# Build BROKEN by default. Disable for release builds.
BROKEN="1"

Expand Down Expand Up @@ -52,6 +55,10 @@ CONTAINER_VERSION="$(jq -r -e .container.version "$SCRIPT_DIR/build-info.json")"
DEFAULT_RELEASE_VERSION="$(make --no-print-directory -C "$SCRIPT_DIR/.." -f ci-build.mk version)"
DEFAULT_RELEASE_VERSION="$DEFAULT_RELEASE_VERSION-$GIT_SHORT_HASH"

# Create site-version from site.mk
SITE_VERSION="$(make --no-print-directory -C "$SCRIPT_DIR/.." -f ci-build.mk site-version)"
SITE_VERSION="$SITE_VERSION-ffda-$GIT_COMMIT_DATE-$GIT_SHORT_HASH"

# Enable Manifest generation conditionally
MANIFEST_STABLE="0"
MANIFEST_BETA="0"
Expand Down Expand Up @@ -151,6 +158,7 @@ echo "build-meta-output=$BUILD_META_TMP_DIR" >> "$BUILD_META_OUTPUT"
echo "container-version=$CONTAINER_VERSION" >> "$BUILD_META_OUTPUT"
echo "gluon-repository=$GLUON_REPOSITORY" >> "$BUILD_META_OUTPUT"
echo "gluon-commit=$GLUON_COMMIT" >> "$BUILD_META_OUTPUT"
echo "site-version=$SITE_VERSION" >> "$BUILD_META_OUTPUT"
echo "release-version=$RELEASE_VERSION" >> "$BUILD_META_OUTPUT"
echo "autoupdater-enabled=$AUTOUPDATER_ENABLED" >> "$BUILD_META_OUTPUT"
echo "autoupdater-branch=$AUTOUPDATER_BRANCH" >> "$BUILD_META_OUTPUT"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
${{ steps.build-metadata.outputs.container-version }}
release-version: >-
${{ steps.build-metadata.outputs.release-version }}
site-version: >-
${{ steps.build-metadata.outputs.site-version }}
autoupdater-enabled: >-
${{ steps.build-metadata.outputs.autoupdater-enabled }}
autoupdater-branch: >-
Expand Down
3 changes: 3 additions & 0 deletions ci-build.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include site.mk

site-version:
@echo $(FFDA_SITE_VERSION)

version:
@echo $(DEFAULT_GLUON_RELEASE)
4 changes: 3 additions & 1 deletion site.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
DEFAULT_GLUON_RELEASE := 2.7~$(shell date '+%Y%m%d')
FFDA_SITE_VERSION := 2.7

DEFAULT_GLUON_RELEASE := $(FFDA_SITE_VERSION)~$(shell date '+%Y%m%d')
DEFAULT_GLUON_PRIORITY := 0

# Enable multidomain support
Expand Down

0 comments on commit 9794ac3

Please sign in to comment.