Merge pull request #852 from owncloud/remove_root_makefile

remove root Makefile and get rid of cd in drone ci
This commit is contained in:
Willy Kloucek
2020-11-23 11:06:06 +01:00
committed by GitHub
6 changed files with 37 additions and 110 deletions
+18 -29
View File
@@ -267,8 +267,7 @@ def testing(ctx, module):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd %s' % (module),
'make vet',
'make -C %s vet' % (module),
],
'volumes': [
{
@@ -282,8 +281,7 @@ def testing(ctx, module):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd %s' % (module),
'make staticcheck',
'make -C %s staticcheck' % (module),
],
'volumes': [
{
@@ -297,8 +295,7 @@ def testing(ctx, module):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd %s' % (module),
'make lint',
'make -C %s lint' % (module),
],
'volumes': [
{
@@ -312,9 +309,8 @@ def testing(ctx, module):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd %s' % (module),
'make test',
'mv coverage.out %s_coverage.out' % (module),
'make -C %s test' % (module),
'mv %s/coverage.out %s_coverage.out' % (module, module),
],
'volumes': [
{
@@ -331,10 +327,9 @@ def testing(ctx, module):
'from_secret': 'cache_s3_endpoint'
},
'bucket': 'cache',
'source': '%s/%s_coverage.out' % (module, module),
'source': '%s_coverage.out' % (module),
'target': '%s/%s/coverage' % (ctx.repo.slug, ctx.build.commit + '-${DRONE_BUILD_NUMBER}'),
'path_style': True,
'strip_prefix': module,
'access_key': {
'from_secret': 'cache_s3_access_key'
},
@@ -466,8 +461,7 @@ def localApiTests(ctx, coreBranch = 'master', coreCommit = '', storage = 'ownclo
'PATH_TO_CORE': '/srv/app/testrunner',
},
'commands': [
'cd ocis',
'make test-acceptance-api',
'make -C ocis test-acceptance-api',
],
'volumes': [{
'name': 'gopath',
@@ -523,8 +517,7 @@ def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, n
'EXPECTED_FAILURES_FILE': '/drone/src/ocis/tests/acceptance/expected-failures-on-%s-storage.txt' % (storage.upper()),
},
'commands': [
'cd /srv/app/testrunner',
'make test-acceptance-api',
'make -C /srv/app/testrunner test-acceptance-api',
],
'volumes': [{
'name': 'gopath',
@@ -923,8 +916,7 @@ def binary(ctx, name):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make release-%s' % (name),
'make -C ocis release-%s' % (name),
],
'volumes': [
{
@@ -938,8 +930,7 @@ def binary(ctx, name):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make release-finish',
'make -C ocis release-finish',
],
'volumes': [
{
@@ -1128,8 +1119,7 @@ def changelog(ctx):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make changelog',
'make -C ocis changelog',
],
},
{
@@ -1269,7 +1259,7 @@ def docs(ctx):
generateConfigDocs = []
for module in config['modules']:
generateConfigDocs += ['cd /drone/src/%s' % (module), 'make config-docs-generate']
generateConfigDocs.append('make -C %s config-docs-generate' % (module))
return {
'kind': 'pipeline',
@@ -1284,7 +1274,7 @@ def docs(ctx):
'name': 'prepare',
'image': 'owncloudci/alpine:latest',
'commands': [
'make docs-copy'
'make -C docs docs-copy'
],
},
{
@@ -1302,15 +1292,16 @@ def docs(ctx):
'name': 'test',
'image': 'owncloudci/hugo:0.71.0',
'commands': [
'cd hugo',
'cd docs/hugo',
'hugo',
],
},
{
'name': 'list',
'name': 'list and remove temporary files',
'image': 'owncloudci/alpine:latest',
'commands': [
'tree hugo/public',
'rm -rf docs/hugo',
],
},
{
@@ -1380,8 +1371,7 @@ def generate(module):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd %s' % (module),
'make generate',
'make -C %s generate' % (module),
],
'volumes': [
{
@@ -1592,8 +1582,7 @@ def build():
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make build',
'make -C ocis build',
],
'volumes': [
{
-56
View File
@@ -1,56 +0,0 @@
SHELL := bash
NAME := ocis
IMPORT := github.com/owncloud/$(NAME)
HUGO := hugo
.PHONY: all
all: build
.PHONY: sync
sync:
go mod download
.PHONY: clean
clean:
rm -rf $(HUGO)
.PHONY: docs-copy
docs-copy:
mkdir -p $(HUGO); \
mkdir -p $(HUGO)/content/; \
cd $(HUGO); \
git init; \
git remote rm origin; \
git remote add origin https://github.com/owncloud/owncloud.github.io; \
git fetch --depth=1; \
git checkout origin/source -f; \
rsync -ax --delete ../docs/ content/; \
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| docs/configuration.md
.PHONY: docs-build
docs-build:
cd $(HUGO); hugo
.PHONY: docs
docs: docs-copy docs-build
BEHAT_BIN=vendor-bin/behat/vendor/bin/behat
.PHONY: test-acceptance-api
test-acceptance-api: vendor-bin/behat/vendor
BEHAT_BIN=$(BEHAT_BIN) $(PATH_TO_CORE)/tests/acceptance/run.sh --remote --type api
vendor/bamarni/composer-bin-plugin: composer.lock
composer install
vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock
composer bin behat install --no-progress
vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json
@echo behat composer.lock is not up to date.
composer.lock: composer.json
@echo composer.lock is not up to date.
+11
View File
@@ -0,0 +1,11 @@
.PHONY: docs-copy
docs-copy:
mkdir -p hugo/content/; \
cd hugo; \
git init; \
git remote rm origin; \
git remote add origin https://github.com/owncloud/owncloud.github.io; \
git fetch --depth=1; \
git checkout origin/source -f; \
rsync -ax --delete --exclude hugo/ --exclude Makefile ../. content/; \
+3 -3
View File
@@ -10,7 +10,7 @@ geekdocFilePath: testing.md
## Acceptance tests
We are using the ownCloud 10 acceptance testsuite against ocis. To set this up you need the owncloud 10 core repo, a ldap server that the acceptance tests can use to manage users, a redis server for file-versions and the oCIS code.
We are using the ownCloud 10 acceptance test suite against oCIS. To set this up you need the ownCloud 10 core repo, a LDAP server that the acceptance tests can use to manage users, a redis server for file-versions and the oCIS code.
### Getting the tests
@@ -42,7 +42,7 @@ In the ownCloud 10 core clone the testing app with the following command:
git clone https://github.com/owncloud/testing apps/testing
```
Then run the api acceptance tests with the following command:
Then run the api acceptance tests with the following command inside the `./ocis` directory:
```
make test-acceptance-api \
TEST_SERVER_URL=https://localhost:9200 \
@@ -84,7 +84,7 @@ If you want to work on a specific issue
}
}
2. locally run each of the tests marked with that issue in the expected failures file
2. locally run each of the tests marked with that issue in the expected failures file. This must be run inside the `./ocis` directory.
E.g.:
```
-18
View File
@@ -139,21 +139,3 @@ config-docs-generate:
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf
BEHAT_BIN=vendor-bin/behat/vendor/bin/behat
.PHONY: test-acceptance-api
test-acceptance-api: vendor-bin/behat/vendor
BEHAT_BIN=$(BEHAT_BIN) $(PATH_TO_CORE)/tests/acceptance/run.sh --remote --type api
vendor/bamarni/composer-bin-plugin: composer.lock
composer install
vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock
composer bin behat install --no-progress
vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json
@echo behat composer.lock is not up to date.
composer.lock: composer.json
@echo composer.lock is not up to date.
+5 -4
View File
@@ -625,22 +625,23 @@ def website(ctx):
'name': 'prepare',
'image': 'owncloudci/alpine:latest',
'commands': [
'make docs-copy'
'make -C docs docs-copy'
],
},
{
'name': 'test',
'image': 'webhippie/hugo:latest',
'commands': [
'cd hugo',
'cd docs/hugo',
'hugo',
],
},
{
'name': 'list',
'name': 'list and remove temporary files',
'image': 'owncloudci/alpine:latest',
'commands': [
'tree hugo/public',
'tree docs/hugo/public',
'rm -rf docs/hugo',
],
},
{