1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 APP_NAME?=arvados-workbench2
7 # GIT_TAG is the last tagged stable release (i.e. 1.2.0)
8 GIT_TAG?=$(shell git describe --abbrev=0)
10 # TS_GIT is the timestamp in the current directory (i.e. 1528815021).
11 # Note that it will only change if files change.
12 TS_GIT?=$(shell git log -n1 --first-parent "--format=format:%ct" .)
14 # DATE_FROM_TS_GIT is the human(ish)-readable version of TS_GIT
15 # 1528815021 -> 20180612145021
16 DATE_FROM_TS_GIT?=$(shell date -ud @$(TS_GIT) +%Y%m%d%H%M%S)
18 # NIGHTLY_VERSION uses all the above to produce X.Y.Z.timestamp
19 # something in the lines of 1.2.0.20180612145021, this will be the package version
20 NIGHTLY_VERSION?=$(GIT_TAG).$(DATE_FROM_TS_GIT)
22 DESCRIPTION=Arvados Workbench2 - Arvados is a free and open source platform for big data science.
23 MAINTAINER=Ward Vandewege <wvandewege@veritasgenetics.com>
25 # DEST_DIR will have the build package copied.
26 DEST_DIR=/var/www/arvados-workbench2/workbench2/
28 export WORKSPACE?=$(shell pwd)
30 .PHONY: help clean* yarn-install test build packages packages-with-version
34 @echo >&2 "There is no default make target here. Did you mean 'make test'?"
36 @echo >&2 "More info:"
37 @echo >&2 " Installing --> http://doc.arvados.org/install"
38 @echo >&2 " Developing/contributing --> https://dev.arvados.org"
39 @echo >&2 " Project home --> https://arvados.org"
44 rm -f $(WORKSPACE)/*.deb
47 rm -f $(WORKSPACE)/*.rpm
50 rm -rf $(WORKSPACE)/node_modules
52 clean: clean-rpm clean-deb clean-node-modules
58 yarn test --no-watchAll --bail --ci
60 build: yarn-install test
63 # use FPM to create DEB and RPM with a version (usually triggered from CI to make a release)
64 packages-with-version: build
70 --maintainer="$(MAINTAINER)" \
71 --description="$(DESCRIPTION)" \
72 --deb-no-default-config-files \
73 $(WORKSPACE)/build/=DEST_DIR
79 --maintainer="$(MAINTAINER)" \
80 --description="$(DESCRIPTION)" \
81 $(WORKSPACE)/build/=DEST_DIR
83 # use FPM to create DEB and RPM
89 -v "$(NIGHTLY_VERSION)" \
90 --maintainer="$(MAINTAINER)" \
91 --description="$(DESCRIPTION)" \
92 --deb-no-default-config-files \
93 $(WORKSPACE)/build/=DEST_DIR
98 -v "$(NIGHTLY_VERSION)" \
99 --maintainer="$(MAINTAINER)" \
100 --description="$(DESCRIPTION)" \
101 $(WORKSPACE)/build/=DEST_DIR