2021-02-24 15:56:53 +03:00
|
|
|
app_name=integration_openproject
|
|
|
|
app_version=$(version)
|
|
|
|
project_dir=.
|
|
|
|
build_dir=/tmp/build
|
|
|
|
sign_dir=/tmp/sign
|
|
|
|
cert_dir=$(HOME)/.nextcloud/certificates
|
|
|
|
webserveruser ?= www-data
|
|
|
|
occ_dir ?= /var/www/html/dev/server
|
|
|
|
|
|
|
|
build_tools_directory=$(CURDIR)/build/tools
|
|
|
|
npm=$(shell which npm 2> /dev/null)
|
|
|
|
composer=$(shell which composer 2> /dev/null)
|
|
|
|
|
2024-01-24 12:59:33 +03:00
|
|
|
#check for BEHAT_FILTER_TAGS env is set any
|
|
|
|
FILTER_TAGS := ~@skip
|
|
|
|
ifdef BEHAT_FILTER_TAGS
|
|
|
|
FILTER_TAGS:=$(FILTER_TAGS)&&${BEHAT_FILTER_TAGS}
|
|
|
|
endif
|
|
|
|
|
2021-02-24 15:56:53 +03:00
|
|
|
all: build
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
ifneq (,$(wildcard $(CURDIR)/composer.json))
|
|
|
|
make composer
|
|
|
|
endif
|
|
|
|
ifneq (,$(wildcard $(CURDIR)/package.json))
|
|
|
|
make npm
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: dev
|
|
|
|
dev:
|
|
|
|
ifneq (,$(wildcard $(CURDIR)/composer.json))
|
|
|
|
make composer
|
|
|
|
endif
|
|
|
|
ifneq (,$(wildcard $(CURDIR)/package.json))
|
|
|
|
make npm-dev
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Installs and updates the composer dependencies. If composer is not installed
|
|
|
|
# a copy is fetched from the web
|
|
|
|
.PHONY: composer
|
|
|
|
composer:
|
|
|
|
ifeq (, $(composer))
|
|
|
|
@echo "No composer command available, downloading a copy from the web"
|
|
|
|
mkdir -p $(build_tools_directory)
|
|
|
|
curl -sS https://getcomposer.org/installer | php
|
|
|
|
mv composer.phar $(build_tools_directory)
|
|
|
|
php $(build_tools_directory)/composer.phar install --prefer-dist
|
|
|
|
else
|
|
|
|
composer install --prefer-dist
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: npm
|
|
|
|
npm:
|
|
|
|
$(npm) ci
|
|
|
|
$(npm) run build
|
|
|
|
|
|
|
|
.PHONY: npm-dev
|
|
|
|
npm-dev:
|
|
|
|
$(npm) ci
|
|
|
|
$(npm) run dev
|
|
|
|
|
2023-07-04 12:06:19 +03:00
|
|
|
.PHONY: psalm
|
|
|
|
psalm:
|
|
|
|
vendor/bin/psalm
|
|
|
|
|
2022-05-03 11:07:58 +03:00
|
|
|
.PHONY: phpunit
|
2022-03-16 14:26:47 +03:00
|
|
|
phpunit:
|
|
|
|
vendor/phpunit/phpunit/phpunit
|
|
|
|
|
2024-08-05 10:39:06 +03:00
|
|
|
# The following make block can be removed once Nextcloud no longer supports PHP 8.0
|
|
|
|
.PHONY: phpunitforphp8.0
|
|
|
|
phpunitforphp8.0:
|
|
|
|
vendor/phpunit/phpunit/phpunit --exclude-group ignoreWithPHP8.0
|
|
|
|
|
2022-05-03 11:07:58 +03:00
|
|
|
.PHONY: jsunit
|
|
|
|
jsunit:
|
2021-12-28 10:26:02 +03:00
|
|
|
npm run test:unit
|
2022-05-03 11:07:58 +03:00
|
|
|
|
|
|
|
.PHONY: api-test
|
|
|
|
api-test:
|
2024-01-23 12:36:24 +03:00
|
|
|
vendor/bin/behat -c tests/acceptance/config/behat.yml --tags '${FILTER_TAGS}' ${FEATURE_PATH}
|
2022-05-03 11:07:58 +03:00
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
test: phpunit jsunit api-test
|
2021-12-27 11:07:20 +03:00
|
|
|
|
2021-02-24 15:56:53 +03:00
|
|
|
clean:
|
|
|
|
sudo rm -rf $(build_dir)
|
|
|
|
sudo rm -rf $(sign_dir)
|
2021-12-28 10:26:02 +03:00
|
|
|
rm -rf node_modules
|
2021-12-27 11:07:20 +03:00
|
|
|
rm -rf vendor
|
2021-02-24 15:56:53 +03:00
|
|
|
|
|
|
|
appstore: clean
|
|
|
|
mkdir -p $(sign_dir)
|
|
|
|
mkdir -p $(build_dir)
|
|
|
|
@rsync -a \
|
|
|
|
--exclude=.git \
|
|
|
|
--exclude=appinfo/signature.json \
|
|
|
|
--exclude=*.swp \
|
|
|
|
--exclude=build \
|
|
|
|
--exclude=.gitignore \
|
|
|
|
--exclude=.travis.yml \
|
|
|
|
--exclude=.scrutinizer.yml \
|
|
|
|
--exclude=CONTRIBUTING.md \
|
|
|
|
--exclude=composer.phar \
|
|
|
|
--exclude=js/node_modules \
|
|
|
|
--exclude=node_modules \
|
|
|
|
--exclude=src \
|
|
|
|
--exclude=translationfiles \
|
|
|
|
--exclude=webpack.* \
|
|
|
|
--exclude=stylelint.config.js \
|
|
|
|
--exclude=.eslintrc.js \
|
|
|
|
--exclude=.github \
|
|
|
|
--exclude=.gitlab-ci.yml \
|
|
|
|
--exclude=crowdin.yml \
|
|
|
|
--exclude=tools \
|
|
|
|
--exclude=.tx \
|
|
|
|
--exclude=.l10nignore \
|
|
|
|
--exclude=l10n/.tx \
|
|
|
|
--exclude=l10n/l10n.pl \
|
|
|
|
--exclude=l10n/templates \
|
|
|
|
--exclude=l10n/*.sh \
|
|
|
|
--exclude=l10n/[a-z][a-z] \
|
|
|
|
--exclude=l10n/[a-z][a-z]_[A-Z][A-Z] \
|
|
|
|
--exclude=l10n/no-php \
|
|
|
|
--exclude=makefile \
|
|
|
|
--exclude=screenshots \
|
|
|
|
--exclude=phpunit*xml \
|
|
|
|
--exclude=tests \
|
|
|
|
--exclude=ci \
|
|
|
|
--exclude=vendor/bin \
|
|
|
|
$(project_dir) $(sign_dir)/$(app_name)
|
|
|
|
@if [ -f $(cert_dir)/$(app_name).key ]; then \
|
|
|
|
sudo chown $(webserveruser) $(sign_dir)/$(app_name)/appinfo ;\
|
|
|
|
sudo -u $(webserveruser) php $(occ_dir)/occ integrity:sign-app --privateKey=$(cert_dir)/$(app_name).key --certificate=$(cert_dir)/$(app_name).crt --path=$(sign_dir)/$(app_name)/ ;\
|
|
|
|
sudo chown -R $(USER) $(sign_dir)/$(app_name)/appinfo ;\
|
|
|
|
else \
|
|
|
|
echo "!!! WARNING signature key not found" ;\
|
|
|
|
fi
|
|
|
|
tar -czf $(build_dir)/$(app_name)-$(app_version).tar.gz \
|
|
|
|
-C $(sign_dir) $(app_name)
|
|
|
|
@if [ -f $(cert_dir)/$(app_name).key ]; then \
|
|
|
|
echo NEXTCLOUD------------------------------------------ ;\
|
|
|
|
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name)-$(app_version).tar.gz | openssl base64 | tee $(build_dir)/sign.txt ;\
|
|
|
|
fi
|