Skip to content

Commit

Permalink
Merge pull request #852 from owncloud/remove_root_makefile
Browse files Browse the repository at this point in the history
remove root Makefile and get rid of cd in drone ci
  • Loading branch information
wkloucek authored Nov 23, 2020
2 parents bdb7433 + 0e1840a commit b614ad1
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 110 deletions.
47 changes: 18 additions & 29 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
{
Expand All @@ -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': [
{
Expand All @@ -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': [
{
Expand All @@ -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': [
{
Expand All @@ -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'
},
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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': [
{
Expand All @@ -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': [
{
Expand Down Expand Up @@ -1128,8 +1119,7 @@ def changelog(ctx):
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make changelog',
'make -C ocis changelog',
],
},
{
Expand Down Expand Up @@ -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',
Expand All @@ -1284,7 +1274,7 @@ def docs(ctx):
'name': 'prepare',
'image': 'owncloudci/alpine:latest',
'commands': [
'make docs-copy'
'make -C docs docs-copy'
],
},
{
Expand All @@ -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',
],
},
{
Expand Down Expand Up @@ -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': [
{
Expand Down Expand Up @@ -1592,8 +1582,7 @@ def build():
'image': 'webhippie/golang:1.14',
'pull': 'always',
'commands': [
'cd ocis',
'make build',
'make -C ocis build',
],
'volumes': [
{
Expand Down
56 changes: 0 additions & 56 deletions Makefile

This file was deleted.

11 changes: 11 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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/; \
6 changes: 3 additions & 3 deletions docs/ocis/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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.:
```
Expand Down
18 changes: 0 additions & 18 deletions storage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
9 changes: 5 additions & 4 deletions store/ocis-boilerplate/.drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
},
{
Expand Down

0 comments on commit b614ad1

Please sign in to comment.