1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 # Use bash, and run all lines in each recipe as one shell command
9 APP_NAME?=arvados-workbench2
11 # GIT_TAG is the last tagged stable release (i.e. 1.2.0)
12 GIT_TAG?=$(shell git describe --abbrev=0)
14 # TS_GIT is the timestamp in the current directory (i.e. 1528815021).
15 # Note that it will only change if files change.
16 TS_GIT?=$(shell git log -n1 --first-parent "--format=format:%ct" .)
18 # DATE_FROM_TS_GIT is the human(ish)-readable version of TS_GIT
19 # 1528815021 -> 20180612145021
20 DATE_FROM_TS_GIT?=$(shell date -ud @$(TS_GIT) +%Y%m%d%H%M%S)
22 # VERSION uses all the above to produce X.Y.Z.timestamp
23 # something in the lines of 1.2.0.20180612145021, this will be the package version
24 # it can be overwritten when invoking make as in make packages VERSION=1.2.0
25 VERSION?=$(GIT_TAG).$(DATE_FROM_TS_GIT)
27 # ITERATION is the package iteration, intended for manual change if anything non-code related
28 # changes in the package. (i.e. example config files externally added
31 DESCRIPTION=Arvados Workbench2 - Arvados is a free and open source platform for big data science.
32 MAINTAINER=Ward Vandewege <wvandewege@veritasgenetics.com>
34 # DEST_DIR will have the build package copied.
35 DEST_DIR=/var/www/arvados-workbench2/workbench2/
38 DEB_FILE=$(APP_NAME)_$(VERSION)-$(ITERATION)_amd64.deb
41 RPM_FILE=$(APP_NAME)-$(VERSION)-$(ITERATION).x86_64.rpm
43 export WORKSPACE?=$(shell pwd)
45 .PHONY: help clean* yarn-install test build packages packages-with-version
49 @echo >&2 "There is no default make target here. Did you mean 'make test'?"
51 @echo >&2 "More info:"
52 @echo >&2 " Installing --> http://doc.arvados.org/install"
53 @echo >&2 " Developing/contributing --> https://dev.arvados.org"
54 @echo >&2 " Project home --> https://arvados.org"
59 rm -f $(WORKSPACE)/*.deb
62 rm -f $(WORKSPACE)/*.rpm
65 rm -rf $(WORKSPACE)/node_modules
67 clean: clean-rpm clean-deb clean-node-modules
73 yarn test --no-watchAll --bail --ci
84 --iteration "$(ITERATION)" \
85 --vendor="The Arvados Authors" \
86 --maintainer="$(MAINTAINER)" \
87 --url="https://arvados.org" \
88 --license="GNU Affero General Public License, version 3.0" \
89 --description="$(DESCRIPTION)" \
90 --config-files="etc/arvados/workbench2/workbench2.example.json" \
91 $(WORKSPACE)/build/=$(DEST_DIR)
99 --iteration "$(ITERATION)" \
100 --vendor="The Arvados Authors" \
101 --maintainer="$(MAINTAINER)" \
102 --url="https://arvados.org" \
103 --license="GNU Affero General Public License, version 3.0" \
104 --description="$(DESCRIPTION)" \
105 --config-files="etc/arvados/workbench2/workbench2.example.json" \
106 $(WORKSPACE)/build/=$(DEST_DIR)
108 copy: $(DEB_FILE) $(RPM_FILE)
109 for target in $(TARGETS); do \
110 if [[ $$target =~ ^centos ]]; then
111 cp -p $(RPM_FILE) packages/$$target ; \
113 cp -p $(DEB_FILE) packages/$$target ; \
119 # use FPM to create DEB and RPM