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 # VERSION uses all the above to produce X.Y.Z.timestamp
12 # something in the lines of 1.2.0.20180612145021, this will be the package version
13 # it can be overwritten when invoking make as in make packages VERSION=1.2.0
14 VERSION?=$(shell ./version-at-commit.sh HEAD)
16 # ITERATION is the package iteration, intended for manual change if anything non-code related
17 # changes in the package. (i.e. example config files externally added
20 TARGETS?=centos7 debian10 debian11 ubuntu1804 ubuntu2004
22 ARVADOS_DIRECTORY?=unset
24 DESCRIPTION=Arvados Workbench2 - Arvados is a free and open source platform for big data science.
25 MAINTAINER=Arvados Package Maintainers <packaging@arvados.org>
27 # DEST_DIR will have the build package copied.
28 DEST_DIR=/var/www/$(APP_NAME)/workbench2/
31 DEB_FILE=$(APP_NAME)_$(VERSION)-$(ITERATION)_amd64.deb
34 RPM_FILE=$(APP_NAME)-$(VERSION)-$(ITERATION).x86_64.rpm
36 export WORKSPACE?=$(shell pwd)
38 .PHONY: help clean* yarn-install test build packages packages-with-version integration-tests-in-docker
42 @echo >&2 "There is no default make target here. Did you mean 'make test'?"
44 @echo >&2 "More info:"
45 @echo >&2 " Installing --> http://doc.arvados.org/install"
46 @echo >&2 " Developing/contributing --> https://dev.arvados.org"
47 @echo >&2 " Project home --> https://arvados.org"
52 rm -f $(WORKSPACE)/*.deb
55 rm -f $(WORKSPACE)/*.rpm
58 rm -rf $(WORKSPACE)/node_modules
60 clean: clean-rpm clean-deb clean-node-modules
62 arvados-server-install:
63 cd $(ARVADOS_DIRECTORY)
68 ~/go/bin/arvados-server install -type test
70 yarn-install: arvados-server-install
73 unit-tests: yarn-install
74 yarn test --no-watchAll --bail --ci
76 integration-tests: yarn-install
77 yarn run cypress install
78 $(WORKSPACE)/tools/run-integration-tests.sh -a $(ARVADOS_DIRECTORY)
80 integration-tests-in-docker: workbench2-build-image
81 docker run -ti -v$(PWD):$(PWD) -w$(PWD) workbench2-build make integration-tests
83 test: unit-tests integration-tests
86 VERSION=$(VERSION) yarn build
94 --iteration "$(ITERATION)" \
95 --vendor="The Arvados Authors" \
96 --maintainer="$(MAINTAINER)" \
97 --url="https://arvados.org" \
98 --license="GNU Affero General Public License, version 3.0" \
99 --description="$(DESCRIPTION)" \
100 --config-files="etc/arvados/$(APP_NAME)/workbench2.example.json" \
101 $(WORKSPACE)/build/=$(DEST_DIR) \
102 etc/arvados/workbench2/workbench2.example.json=/etc/arvados/$(APP_NAME)/workbench2.example.json
110 --iteration "$(ITERATION)" \
111 --vendor="The Arvados Authors" \
112 --maintainer="$(MAINTAINER)" \
113 --url="https://arvados.org" \
114 --license="GNU Affero General Public License, version 3.0" \
115 --description="$(DESCRIPTION)" \
116 --config-files="etc/arvados/$(APP_NAME)/workbench2.example.json" \
117 $(WORKSPACE)/build/=$(DEST_DIR) \
118 etc/arvados/workbench2/workbench2.example.json=/etc/arvados/$(APP_NAME)/workbench2.example.json
120 copy: $(DEB_FILE) $(RPM_FILE)
121 for target in $(TARGETS) ; do \
122 mkdir -p packages/$$target
123 if [[ $$target =~ ^centos ]]; then
124 cp -p $(RPM_FILE) packages/$$target ; \
126 cp -p $(DEB_FILE) packages/$$target ; \
132 # use FPM to create DEB and RPM
135 packages-in-docker: workbench2-build-image
136 docker run --env ci="true" \
137 --env ARVADOS_DIRECTORY=/tmp/arvados \
138 --env APP_NAME=${APP_NAME} \
139 --env ITERATION=${ITERATION} \
140 --env TARGETS="${TARGETS}" \
141 -w="/tmp/workbench2" \
142 -t -v ${WORKSPACE}:/tmp/workbench2 \
143 -v ${ARVADOS_DIRECTORY}:/tmp/arvados workbench2-build:latest \
146 workbench2-build-image:
147 (cd docker && docker build -t workbench2-build .)