From 8f54231d629ec8d1444fb0751d59b732f1cbcbd2 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 7 Jan 2019 11:21:10 +0000 Subject: [PATCH] CI: Start to get the build details into the build --- .travis.yml | 2 +- bin/build-site.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1afc0c719..f88d62b35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ jobs: - stage: build script: - npm --force install tiddlywiki - - export GIT_DETAILS="$TRAVIS_BRANCH-$(git rev-parse HEAD) from $(git remote get-url origin)" + - export TW5_BUILD_DETAILS="$TRAVIS_BRANCH-$(git rev-parse HEAD) from $(git remote get-url origin)" - export TW5_BUILD_TIDDLYWIKI='./node_modules/tiddlywiki/tiddlywiki.js' - ./bin/build-site.sh - ./bin/deploy-site.sh diff --git a/bin/build-site.sh b/bin/build-site.sh index a5e02f9e3..6ffc6e6cf 100755 --- a/bin/build-site.sh +++ b/bin/build-site.sh @@ -20,6 +20,12 @@ if [ -z "$TW5_BUILD_TIDDLYWIKI" ]; then TW5_BUILD_TIDDLYWIKI=./tiddlywiki.js fi +# Set up the build details + +if [ -z "$TW5_BUILD_DETAILS" ]; then + TW5_BUILD_DETAILS="$(git symbolic-ref --short HEAD)-$(git rev-parse HEAD) from $(git remote get-url origin)" +fi + # Set up the build output directory if [ -z "$TW5_BUILD_OUTPUT" ]; then @@ -35,7 +41,7 @@ fi echo "Using TW5_BUILD_OUTPUT as [$TW5_BUILD_OUTPUT]" -echo "Git details: $GIT_DETAILS" +echo "Build details: $TW5_BUILD_DETAILS" # Make the CNAME file that GitHub Pages requires @@ -58,6 +64,10 @@ echo "Moved to http://tiddly echo "Moved to http://tiddlywiki.com/plugins/tiddlywiki/markdown/index.html" > $TW5_BUILD_OUTPUT/markdowndemo.html echo "Moved to http://tiddlywiki.com/plugins/tiddlywiki/tahoelafs/index.html" > $TW5_BUILD_OUTPUT/tahoelafs.html +# Put the build details into a .tid file so that it can be included in each build + +echo "title: $:/build\ntext: $TW5_BUILD_DETAILS\n" > $TW5_BUILD_OUTPUT/build.tid + ###################################################### # # Core distribution @@ -75,10 +85,13 @@ node $TW5_BUILD_TIDDLYWIKI \ $TW5_BUILD_MAIN_EDITION \ --verbose \ --version \ + --load $TW5_BUILD_OUTPUT/build.tid \ --output $TW5_BUILD_OUTPUT \ --build favicon static index \ || exit 1 +more $TW5_BUILD_OUTPUT/build.tid + # # /empty.html Empty # # /empty.hta For Internet Explorer # node $TW5_BUILD_TIDDLYWIKI \