Skip to content

Commit 7ec9d02

Browse files
committed
Create build-info.json when building plugin
1 parent 84c7af8 commit 7ec9d02

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.#*
44
\#*\#
55
build
6+
build-info.json
67
.DS_Store
78
serverConfiguration.json
89
src/webfrontend/node_modules

Makefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ all: install build
99
install:
1010
cd src/webfrontend && npm install
1111

12-
build: clean
12+
build: clean buildinfojson
1313
mkdir -p build
1414
mkdir -p build/$(PLUGIN_NAME)
1515
mkdir -p build/$(PLUGIN_NAME)/webfrontend
@@ -32,5 +32,19 @@ build: clean
3232

3333
cp manifest.master.yml build/$(PLUGIN_NAME)/manifest.yml
3434

35+
cp build-info.json build/$(PLUGIN_NAME)/build-info.json
36+
3537
clean:
3638
rm -rf build
39+
40+
buildinfojson:
41+
repo=`git remote get-url origin | sed -e 's/\.git$$//' -e 's#.*[/\\]##'` ;\
42+
rev=`git show --no-patch --format=%H` ;\
43+
lastchanged=`git show --no-patch --format=%ad --date=format:%Y-%m-%dT%T%z` ;\
44+
builddate=`date +"%Y-%m-%dT%T%z"` ;\
45+
echo '{' > build-info.json ;\
46+
echo ' "repository": "'$$repo'",' >> build-info.json ;\
47+
echo ' "rev": "'$$rev'",' >> build-info.json ;\
48+
echo ' "lastchanged": "'$$lastchanged'",' >> build-info.json ;\
49+
echo ' "builddate": "'$$builddate'"' >> build-info.json ;\
50+
echo '}' >> build-info.json

0 commit comments

Comments
 (0)