From 63c6a438b650b883e4fdc30207ae69527bd93f6e Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 20 Apr 2021 08:54:32 +0200 Subject: [PATCH 1/2] use official redis --- .drone.star | 5 +-- .../owncloud10_with_oc_web/docker-compose.yml | 34 +++++++++---------- tests/acceptance/docker/src/redis.yml | 5 ++- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.drone.star b/.drone.star index c83164299e5..767e8336e80 100644 --- a/.drone.star +++ b/.drone.star @@ -1370,11 +1370,8 @@ def redis(): return [ { 'name': 'redis', - 'image': 'webhippie/redis', + 'image': 'redis:6-alpine', 'pull': 'always', - 'environment': { - 'REDIS_DATABASES': 1 - }, } ] diff --git a/deployments/examples/owncloud10_with_oc_web/docker-compose.yml b/deployments/examples/owncloud10_with_oc_web/docker-compose.yml index 7bd3d97a591..ef43039321b 100644 --- a/deployments/examples/owncloud10_with_oc_web/docker-compose.yml +++ b/deployments/examples/owncloud10_with_oc_web/docker-compose.yml @@ -165,38 +165,38 @@ services: restart: always db: - image: webhippie/mariadb:latest + image: mariadb:10.5 environment: - MARIADB_ROOT_PASSWORD: owncloud - MARIADB_USERNAME: owncloud - MARIADB_PASSWORD: owncloud - MARIADB_DATABASE: owncloud - MARIADB_MAX_ALLOWED_PACKET: 128M - MARIADB_INNODB_LOG_FILE_SIZE: 256M + - MYSQL_ROOT_PASSWORD=owncloud + - MYSQL_USER=owncloud + - MYSQL_PASSWORD=owncloud + - MYSQL_DATABASE=owncloud + command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"] healthcheck: - test: ["CMD", "/usr/bin/healthcheck"] - interval: 30s - timeout: 10s + test: ["CMD", "mysqladmin", "ping", "-u", "root", "--password=owncloud"] + interval: 10s + timeout: 5s retries: 5 volumes: - mysql:/var/lib/mysql - - backup:/var/lib/backup logging: driver: "local" restart: always redis: - image: webhippie/redis:latest - environment: - - REDIS_DATABASES=1 + image: redis:6 + command: ["--databases", "1"] + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 10s + timeout: 5s + retries: 5 volumes: - - redis:/var/lib/redis + - redis:/data logging: driver: "local" restart: always - - volumes: certs: ocis-data: diff --git a/tests/acceptance/docker/src/redis.yml b/tests/acceptance/docker/src/redis.yml index 7f9a0239ecc..8838b598fc0 100644 --- a/tests/acceptance/docker/src/redis.yml +++ b/tests/acceptance/docker/src/redis.yml @@ -1,5 +1,4 @@ services: redis: - image: webhippie/redis - environment: - REDIS_DATABASES: 1 + image: redis:6 + command: ["--databases", "1"] From 8610b2560d1cb0b4283dc0679223588952b86aea Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 20 Apr 2021 08:56:22 +0200 Subject: [PATCH 2/2] cleanup uneeded boilerplate code --- store/ocis-boilerplate/.codacy.yml | 8 - store/ocis-boilerplate/.drone.star | 699 -------------------- store/ocis-boilerplate/.editorconfig | 35 - store/ocis-boilerplate/.github/config.yml | 12 - store/ocis-boilerplate/.github/settings.yml | 98 --- store/ocis-boilerplate/.gitignore | 8 - 6 files changed, 860 deletions(-) delete mode 100644 store/ocis-boilerplate/.codacy.yml delete mode 100644 store/ocis-boilerplate/.drone.star delete mode 100644 store/ocis-boilerplate/.editorconfig delete mode 100644 store/ocis-boilerplate/.github/config.yml delete mode 100644 store/ocis-boilerplate/.github/settings.yml delete mode 100644 store/ocis-boilerplate/.gitignore diff --git a/store/ocis-boilerplate/.codacy.yml b/store/ocis-boilerplate/.codacy.yml deleted file mode 100644 index 855b4f298b5..00000000000 --- a/store/ocis-boilerplate/.codacy.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -exclude_paths: - - CHANGELOG.md - - changelog/** - - docs/** - - pkg/proto/** - -... diff --git a/store/ocis-boilerplate/.drone.star b/store/ocis-boilerplate/.drone.star deleted file mode 100644 index 9acb0ce7a80..00000000000 --- a/store/ocis-boilerplate/.drone.star +++ /dev/null @@ -1,699 +0,0 @@ -def main(ctx): - before = [ - testing(ctx), - ] - - stages = [ - docker(ctx, 'amd64'), - docker(ctx, 'arm64'), - docker(ctx, 'arm'), - binary(ctx, 'linux'), - binary(ctx, 'darwin'), - binary(ctx, 'windows'), - ] - - after = [ - manifest(ctx), - changelog(ctx), - readme(ctx), - badges(ctx), - website(ctx), - ] - - return before + stages + after - -def testing(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'testing', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'generate', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make generate', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'vet', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make vet', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'staticcheck', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make staticcheck', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'lint', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make lint', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'test', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make test', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'codacy', - 'image': 'plugins/codacy:1', - 'pull': 'always', - 'settings': { - 'token': { - 'from_secret': 'codacy_token', - }, - }, - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -def docker(ctx, arch): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': arch, - 'platform': { - 'os': 'linux', - 'arch': arch, - }, - 'steps': [ - { - 'name': 'generate', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make generate', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'dryrun', - 'image': 'plugins/docker:18.09', - 'pull': 'always', - 'settings': { - 'dry_run': True, - 'tags': 'linux-%s' % (arch), - 'dockerfile': 'docker/Dockerfile.linux.%s' % (arch), - 'repo': ctx.repo.slug, - }, - 'when': { - 'ref': { - 'include': [ - 'refs/pull/**', - ], - }, - }, - }, - { - 'name': 'docker', - 'image': 'plugins/docker:18.09', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'docker_username', - }, - 'password': { - 'from_secret': 'docker_password', - }, - 'auto_tag': True, - 'auto_tag_suffix': 'linux-%s' % (arch), - 'dockerfile': 'docker/Dockerfile.linux.%s' % (arch), - 'repo': ctx.repo.slug, - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - ], - 'depends_on': [ - 'testing', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -def binary(ctx, name): - if ctx.build.event == "tag": - settings = { - 'endpoint': { - 'from_secret': 's3_endpoint', - }, - 'access_key': { - 'from_secret': 'aws_access_key_id', - }, - 'secret_key': { - 'from_secret': 'aws_secret_access_key', - }, - 'bucket': { - 'from_secret': 's3_bucket', - }, - 'path_style': True, - 'strip_prefix': 'dist/release/', - 'source': 'dist/release/*', - 'target': '/ocis/%s/%s' % (ctx.repo.name.replace("ocis-", ""), ctx.build.ref.replace("refs/tags/v", "")), - } - else: - settings = { - 'endpoint': { - 'from_secret': 's3_endpoint', - }, - 'access_key': { - 'from_secret': 'aws_access_key_id', - }, - 'secret_key': { - 'from_secret': 'aws_secret_access_key', - }, - 'bucket': { - 'from_secret': 's3_bucket', - }, - 'path_style': True, - 'strip_prefix': 'dist/release/', - 'source': 'dist/release/*', - 'target': '/ocis/%s/testing' % (ctx.repo.name.replace("ocis-", "")), - } - - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': name, - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'generate', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make generate', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make release-%s' % (name), - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'finish', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make release-finish', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'upload', - 'image': 'plugins/s3:1', - 'pull': 'always', - 'settings': settings, - 'when': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - ], - }, - }, - { - 'name': 'changelog', - 'image': 'toolhippie/calens:latest', - 'pull': 'always', - 'commands': [ - 'calens --version %s -o dist/CHANGELOG.md' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0], - ], - 'when': { - 'ref': [ - 'refs/tags/**', - ], - }, - }, - { - 'name': 'release', - 'image': 'plugins/github-release:1', - 'pull': 'always', - 'settings': { - 'api_key': { - 'from_secret': 'github_token', - }, - 'files': [ - 'dist/release/*', - ], - 'title': ctx.build.ref.replace("refs/tags/v", ""), - 'note': 'dist/CHANGELOG.md', - 'overwrite': True, - 'prerelease': len(ctx.build.ref.split("-")) > 1, - }, - 'when': { - 'ref': [ - 'refs/tags/**', - ], - }, - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - ], - 'depends_on': [ - 'testing', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -def manifest(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'manifest', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'plugins/manifest:1', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'docker_username', - }, - 'password': { - 'from_secret': 'docker_password', - }, - 'spec': 'docker/manifest.tmpl', - 'auto_tag': True, - 'ignore_missing': True, - }, - }, - ], - 'depends_on': [ - 'amd64', - 'arm64', - 'arm', - 'linux', - 'darwin', - 'windows', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - ], - }, - } - -def changelog(ctx): - repo_slug = ctx.build.source_repo if ctx.build.source_repo else ctx.repo.slug - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'changelog', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'clone': { - 'disable': True, - }, - 'steps': [ - { - 'name': 'clone', - 'image': 'plugins/git-action:1', - 'pull': 'always', - 'settings': { - 'actions': [ - 'clone', - ], - 'remote': 'https://github.com/%s' % (repo_slug), - 'branch': ctx.build.source if ctx.build.event == 'pull_request' else 'master', - 'path': '/drone/src', - 'netrc_machine': 'github.com', - 'netrc_username': { - 'from_secret': 'github_username', - }, - 'netrc_password': { - 'from_secret': 'github_token', - }, - }, - }, - { - 'name': 'generate', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make changelog', - ], - }, - { - 'name': 'diff', - 'image': 'owncloud/alpine:latest', - 'pull': 'always', - 'commands': [ - 'git diff', - ], - }, - { - 'name': 'output', - 'image': 'owncloud/alpine:latest', - 'pull': 'always', - 'commands': [ - 'cat CHANGELOG.md', - ], - }, - { - 'name': 'publish', - 'image': 'plugins/git-action:1', - 'pull': 'always', - 'settings': { - 'actions': [ - 'commit', - 'push', - ], - 'message': 'Automated changelog update [skip ci]', - 'branch': 'master', - 'author_email': 'devops@owncloud.com', - 'author_name': 'ownClouders', - 'netrc_machine': 'github.com', - 'netrc_username': { - 'from_secret': 'github_username', - }, - 'netrc_password': { - 'from_secret': 'github_token', - }, - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - ], - 'depends_on': [ - 'manifest', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/pull/**', - ], - }, - } - -def readme(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'readme', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'sheogorath/readme-to-dockerhub:latest', - 'pull': 'always', - 'environment': { - 'DOCKERHUB_USERNAME': { - 'from_secret': 'docker_username', - }, - 'DOCKERHUB_PASSWORD': { - 'from_secret': 'docker_password', - }, - 'DOCKERHUB_REPO_PREFIX': ctx.repo.namespace, - 'DOCKERHUB_REPO_NAME': ctx.repo.name, - 'SHORT_DESCRIPTION': 'Docker images for %s' % (ctx.repo.name), - 'README_PATH': 'README.md', - }, - }, - ], - 'depends_on': [ - 'changelog', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - ], - }, - } - -def badges(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'badges', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'execute', - 'image': 'plugins/webhook:1', - 'pull': 'always', - 'settings': { - 'urls': { - 'from_secret': 'microbadger_url', - }, - }, - }, - ], - 'depends_on': [ - 'readme', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - ], - }, - } - -def website(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'website', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'prepare', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'make -C docs docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd docs/hugo', - 'hugo', - ], - }, - { - 'name': 'list and remove temporary files', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree docs/hugo/public', - 'rm -rf docs/hugo', - ], - }, - { - 'name': 'publish', - 'image': 'plugins/gh-pages:1', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'github_username', - }, - 'password': { - 'from_secret': 'github_token', - }, - 'pages_directory': 'docs/', - 'target_branch': 'docs', - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - { - 'name': 'downstream', - 'image': 'plugins/downstream', - 'settings': { - 'server': 'https://cloud.drone.io/', - 'token': { - 'from_secret': 'drone_token', - }, - 'repositories': [ - 'owncloud/owncloud.github.io@source', - ], - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - ], - 'depends_on': [ - 'badges', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/pull/**', - ], - }, - } diff --git a/store/ocis-boilerplate/.editorconfig b/store/ocis-boilerplate/.editorconfig deleted file mode 100644 index 77129cd3933..00000000000 --- a/store/ocis-boilerplate/.editorconfig +++ /dev/null @@ -1,35 +0,0 @@ -# http://editorconfig.org - -root = true - -[*] -charset = utf-8 -insert_final_newline = true -trim_trailing_whitespace = true - -[Makefile] -indent_style = tab -indent_size = 4 - -[*.go] -indent_style = tab -indent_size = 4 - -[*.starlark] -indent_style = space -indent_size = 2 - -[*.{yml,json}] -indent_style = space -indent_size = 2 - -[*.{js,vue}] -indent_style = space -indent_size = 2 - -[*.{css,less}] -indent_style = space -indent_size = 2 - -[*.md] -trim_trailing_whitespace = true diff --git a/store/ocis-boilerplate/.github/config.yml b/store/ocis-boilerplate/.github/config.yml deleted file mode 100644 index 3efdb7cbe59..00000000000 --- a/store/ocis-boilerplate/.github/config.yml +++ /dev/null @@ -1,12 +0,0 @@ -# Configuration for update-docs - https://github.com/behaviorbot/update-docs - -# Comment to be posted to on PRs that don't update documentation -updateDocsComment: > - Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis/store/blob/master/changelog/README.md) item based on your changes. -updateDocsWhiteList: - - Tests-only - - tests-only - - Tests-Only - -updateDocsTargetFiles: - - changelog/unreleased/ diff --git a/store/ocis-boilerplate/.github/settings.yml b/store/ocis-boilerplate/.github/settings.yml deleted file mode 100644 index 7625e27173a..00000000000 --- a/store/ocis-boilerplate/.github/settings.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -repository: - name: ocis-store - description: ':atom_symbol: Store Service for oCIS' - homepage: https://owncloud.dev/extensions/ocis_store/ - topics: reva, ocis - - private: false - has_issues: true - has_projects: false - has_wiki: false - has_downloads: false - - default_branch: master - - allow_squash_merge: true - allow_merge_commit: true - allow_rebase_merge: true - -labels: - - name: bug - color: d73a4a - description: Something isn't working - - name: documentation - color: 0075ca - description: Improvements or additions to documentation - - name: duplicate - color: cfd3d7 - description: This issue or pull request already exists - - name: enhancement - color: a2eeef - description: New feature or request - - name: good first issue - color: 7057ff - description: Good for newcomers - - name: help wanted - color: 008672 - description: Extra attention is needed - - name: invalid - color: e4e669 - description: This doesn't seem right - - name: question - color: d876e3 - description: Further information is requested - - name: wontfix - color: ffffff - description: This will not be worked on - - name: effort/trivial - color: c2e0c6 - description: Required effort to finish task - - name: effort/0.25d - color: c2e0c6 - description: Required effort to finish task - - name: effort/0.5d - color: c2e0c6 - description: Required effort to finish task - - name: effort/1d - color: c2e0c6 - description: Required effort to finish task - - name: effort/2d - color: c2e0c6 - description: Required effort to finish task - - name: effort/4d - color: c2e0c6 - description: Required effort to finish task - - name: effort/5d - color: c2e0c6 - description: Required effort to finish task - - name: effort/10d - color: c2e0c6 - description: Required effort to finish task - -teams: - - name: ci - permission: admin - - name: employees - permission: push - -branches: - - name: master - protection: - required_pull_request_reviews: - required_approving_review_count: 1 - dismiss_stale_reviews: false - require_code_owner_reviews: false - dismissal_restrictions: {} - required_status_checks: - strict: true - contexts: - - continuous-integration/drone/pr - enforce_admins: false - restrictions: - users: [] - teams: - - ci - - employees - -... diff --git a/store/ocis-boilerplate/.gitignore b/store/ocis-boilerplate/.gitignore deleted file mode 100644 index 6067678797a..00000000000 --- a/store/ocis-boilerplate/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -coverage.out - -/bin -/dist -/hugo - -/node_modules -/assets