Add build info to deployed version

This commit is contained in:
Slava Bacherikov committed 2018-02-02 17:01:07 +02:00
1 parent 611ed749c9
commit 7fb1918fcb
2 files changed
+11 -2

No files matched your search

+10 -2
View File
@@ -14,8 +14,16 @@ build_package() {
PRODUCTION=1 npm run webpack
}
build_info() {
VERSION=$(git describe --tags --always)
echo "version: ${VERSION}" >> dist/version-info.txt
echo "time: $(TZ=UTC date +'%Y-%m-%d %H:%M')" >> dist/version-info.txt
if [ -n "$TRAVIS" ]; then
echo "build id: TRAVIS ${TRAVIS_JOB_NUMBER} (${TRAVIS_BUILD_ID})" >> dist/version-info.txt
fi
}
install_closure
build_package
ls dist/
build_info
+1
View File
@@ -12,6 +12,7 @@ UPLOAD_ORDER = [
CACHE_RULES = [
(re.compile(r'.*\.html$'), "public, max-age=120"),
(re.compile(r'^version-info\.txt$'), "public, max-age=60"),
(re.compile(r'.*\.(css|js)$'), "public, s-maxage=31536000, max-age=86400")
]