diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..95218e8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,58 @@ +workspace: + base: /var/www/owncloud + path: apps/testing + +branches: + - master + +pipeline: + prepare-lint: + image: owncloudci/php + pull: true + commands: + - make vendor-bin/php-parallel-lint/vendor + + lint-php5: + image: owncloudci/php:5.6 + pull: true + group: lint + commands: + - make test-php-lint + + lint-php70: + image: owncloudci/php:7.0 + pull: true + group: lint + commands: + - make test-php-lint + + lint-php71: + image: owncloudci/php:7.1 + pull: true + group: lint + commands: + - make test-php-lint + + lint-php72: + image: owncloudci/php:7.2 + pull: true + group: lint + commands: + - make test-php-lint + + build: + image: owncloudci/php:7.1 + pull: true + commands: + - make dist + + github_release: + image: plugins/github-release + pull: true + secrets: [ github_token ] + files: build/dist/testing.tar.gz + prerelease: true + file_exists: overwrite + checksum: sha256 + when: + event: tag \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73afa8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build +/vendor/ +vendor-bin/**/vendor +vendor-bin/**/composer.lock \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..01b5f93 --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +SHELL := /bin/bash + +COMPOSER_BIN := $(shell command -v composer 2> /dev/null) +ifndef COMPOSER_BIN + $(error composer is not available on your system, please install composer) +endif + +# directories +app_name=$(notdir $(CURDIR)) +build_dir=$(CURDIR)/build +dist_dir=$(build_dir)/dist +src_files=README.md LICENSE +src_dirs=appinfo data img lib locking +all_src=$(src_dirs) $(src_files) + +# bin file definitions +PHPLINT=php -d zend.enable_gc=0 vendor-bin/php-parallel-lint/vendor/bin/parallel-lint + +# start with displaying help +.DEFAULT_GOAL := help + +help: + @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' + + + +## +## Build targets +##-------------------------------------- + +.PHONY: dist +dist: ## Build distribution +dist: distdir package + +.PHONY: distdir +distdir: + rm -rf $(build_dir) + mkdir -p $(dist_dir)/$(app_name) + cp -R $(all_src) $(dist_dir)/$(app_name) + +.PHONY: package +package: + tar -czf $(dist_dir)/$(app_name).tar.gz -C $(dist_dir) $(app_name) + +## +## Tests +##-------------------------------------- + +.PHONY: test-php-lint +test-php-lint: ## Run phan +test-php-lint: vendor-bin/php-parallel-lint/vendor + $(PHPLINT) appinfo lib locking + +# +# Dependency management +#-------------------------------------- + +composer.lock: composer.json + @echo composer.lock is not up to date. + +vendor: + composer install --no-dev + +vendor/bamarni/composer-bin-plugin: + composer install + +vendor-bin/php-parallel-lint/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php-parallel-lint/composer.lock + composer bin php-parallel-lint install --no-progress + +vendor-bin/php-parallel-lint/composer.lock: vendor-bin/php-parallel-lint/composer.json + @echo php-parallel-lint composer.lock is not up to date. \ No newline at end of file diff --git a/README.md b/README.md index 023de37..cabb56f 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,10 @@ git clone https://github.com/owncloud/testing.git php occ app:enable testing ``` + +## Publish latest version as github release + +The latest published version can be found at https://github.com/owncloud/testing/releases/tag/latest + +In order to update the latest version to be available, we need to move the github tag to a new HEAD. +Once the tag `latest` is pushed to github, drone-ci will build and publish the app to github \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9574b12 --- /dev/null +++ b/composer.json @@ -0,0 +1,15 @@ +{ + "name": "owncloud/testing", + "description": "ownCloud testing app", + "type": "owncloud-app", + "license": "AGPL", + "require": {}, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2" + }, + "extra": { + "bamarni-bin": { + "bin-links": false + } + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..00cc44d --- /dev/null +++ b/composer.lock @@ -0,0 +1,57 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "a1f4c002bfc144d81b235e34066bb3d4", + "packages": [], + "packages-dev": [ + { + "name": "bamarni/composer-bin-plugin", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/bamarni/composer-bin-plugin.git", + "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/62fef740245a85f00665e81ea8f0aa0b72afe6e7", + "reference": "62fef740245a85f00665e81ea8f0aa0b72afe6e7", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "require-dev": { + "composer/composer": "dev-master", + "symfony/console": "^2.5 || ^3.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Bamarni\\Composer\\Bin\\Plugin", + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Bamarni\\Composer\\Bin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "time": "2017-09-11T13:13:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/vendor-bin/php-parallel-lint/composer.json b/vendor-bin/php-parallel-lint/composer.json new file mode 100644 index 0000000..a05eec3 --- /dev/null +++ b/vendor-bin/php-parallel-lint/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "jakub-onderka/php-parallel-lint": "^1.0" + } +}