diff --git a/accounts/.drone.star b/accounts/.drone.star deleted file mode 100644 index 8aed252cb1..0000000000 --- a/accounts/.drone.star +++ /dev/null @@ -1,904 +0,0 @@ -def main(ctx): - before = [ - testing(ctx), - UITests(ctx, 'master', '1840e805bd1bef2e8ee2935de47076a3f2ca3788', 'master', 'e0746d8d3a5879d2c0cd4aaf30c07ee98ab2b945') - ] - - 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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn lint', - 'yarn test', - 'yarn build', - ], - }, - { - '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 protobuf 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', - }, - }, - }, - { - 'name': 'sonarcloud', - 'image': 'sonarsource/sonar-scanner-cli', - 'pull': 'always', - 'environment': { - 'SONAR_TOKEN': { - 'from_secret': 'sonar_token', - }, - 'SONAR_PULL_REQUEST_BASE': 'master' if ctx.build.event == 'pull_request' else None, - 'SONAR_PULL_REQUEST_BRANCH': ctx.build.source if ctx.build.event == 'pull_request' else None, - 'SONAR_PULL_REQUEST_KEY': ctx.build.ref.replace("refs/pull/", "").split("/")[0] if ctx.build.event == 'pull_request' else None, - }, - }, - ], - '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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn build', - ], - }, - { - '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 protobuf 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', - 'UiTests', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -def UITests(ctx, ocisBranch, ocisCommitId, phoenixBranch, phoenixCommitId): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'UiTests', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make protobuf build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build-ocis', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/ocis /srv/app/ocis' % (ocisBranch), - 'cd /srv/app/ocis', - 'git checkout %s' % (ocisCommitId), - 'make build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app' - }, - ] - }, - { - 'name': 'ocis-server', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'detach': True, - 'environment' : { - 'REVA_STORAGE_HOME_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_LOCAL_ROOT': '/srv/app/tmp/reva/root', - 'REVA_STORAGE_OWNCLOUD_DATADIR': '/srv/app/tmp/reva/data', - 'REVA_STORAGE_OC_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', - 'REVA_OIDC_ISSUER': 'https://ocis-server:9200', - 'PROXY_OIDC_ISSUER': 'https://ocis-server:9200', - 'REVA_STORAGE_OC_DATA_SERVER_URL': 'http://ocis-server:9164/data', - 'REVA_DATAGATEWAY_URL': 'https://ocis-server:9200/data', - 'REVA_FRONTEND_URL': 'https://ocis-server:9200', - 'REVA_LDAP_IDP': 'https://ocis-server:9200', - 'PHOENIX_WEB_CONFIG': '/drone/src/ui/tests/config/drone/ocis-config.json', - 'KONNECTD_IDENTIFIER_REGISTRATION_CONF': '/drone/src/ui/tests/config/drone/identifier-registration.yml', - 'KONNECTD_ISS': 'https://ocis-server:9200', - }, - 'commands': [ - 'mkdir -p /srv/app/tmp/reva', - # First run settings service because accounts need it to register the settings bundles - '/srv/app/ocis/bin/ocis settings &', - - # Wait for the settings service to start - "while [[ \"$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9190)\" != \"404\" ]]; do sleep 2; done", - - # Now start the accounts service - 'bin/ocis-accounts server &', - - # Wait for the accounts service to start - "while [[ \"$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9181)\" != \"404\" ]]; do sleep 2; done", - - # Now run all the ocis services except the accounts and settings because they are already running - '/srv/app/ocis/bin/ocis server', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app' - }, - ] - }, - { - 'name': 'WebUIAcceptanceTests', - 'image': 'owncloudci/nodejs:10', - 'pull': 'always', - 'environment': { - 'SERVER_HOST': 'https://ocis-server:9200', - 'BACKEND_HOST': 'https://ocis-server:9200', - 'RUN_ON_OCIS': 'true', - 'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva', - 'OCIS_SKELETON_DIR': '/srv/app/testing/data/webUISkeleton', - 'PHOENIX_CONFIG': '/drone/src/ui/tests/config/drone/ocis-config.json', - 'TEST_TAGS': 'not @skipOnOCIS and not @skip', - 'LOCAL_UPLOAD_DIR': '/uploads', - 'PHOENIX_PATH': '/srv/app/phoenix', - 'FEATURE_PATH': 'ui/tests/acceptance/features', - 'NODE_TLS_REJECT_UNAUTHORIZED': '0' - }, - 'commands': [ - 'git clone --depth=1 https://github.com/owncloud/testing.git /srv/app/testing', - 'git clone -b %s --single-branch https://github.com/owncloud/phoenix /srv/app/phoenix' % (phoenixBranch), - 'cd /srv/app/phoenix', - 'git checkout %s' % (phoenixCommitId), - 'cp -r /srv/app/phoenix/tests/acceptance/filesForUpload/* /uploads', - 'yarn install-all', - 'cd /drone/src', - 'yarn install --all', - 'make test-acceptance-webui' - ], - 'volumes': [{ - 'name': 'gopath', - 'path': '/srv/app', - }, - { - 'name': 'uploads', - 'path': '/uploads' - }] - }, - ], - 'services': [ - { - 'name': 'redis', - 'image': 'webhippie/redis', - 'pull': 'always', - 'environment': { - 'REDIS_DATABASES': 1 - }, - }, - { - 'name': 'selenium', - 'image': 'selenium/standalone-chrome-debug:3.141.59-20200326', - 'pull': 'always', - 'volumes': [{ - 'name': 'uploads', - 'path': '/uploads' - }], - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - { - 'name': 'uploads', - 'temp': {} - } - ], - '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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn build', - ], - }, - { - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/glauth/.drone.star b/glauth/.drone.star deleted file mode 100644 index a204a15edb..0000000000 --- a/glauth/.drone.star +++ /dev/null @@ -1,698 +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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/konnectd/.drone.star b/konnectd/.drone.star deleted file mode 100644 index 30a7cd204e..0000000000 --- a/konnectd/.drone.star +++ /dev/null @@ -1,698 +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': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'git diff', - ], - }, - { - 'name': 'output', - 'image': 'webhippie/golang:1.13', - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/ocis-phoenix/.drone.star b/ocis-phoenix/.drone.star deleted file mode 100644 index a204a15edb..0000000000 --- a/ocis-phoenix/.drone.star +++ /dev/null @@ -1,698 +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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/ocis-pkg/.drone.star b/ocis-pkg/.drone.star deleted file mode 100644 index fa8ea2d84c..0000000000 --- a/ocis-pkg/.drone.star +++ /dev/null @@ -1,282 +0,0 @@ -def main(ctx): - stages = [ - testing(ctx), - ] - - after = [ - changelog(ctx), - publish(ctx), - ] - - return 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 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': 'webhippie/golang:1.13', - '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': [ - 'testing', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/pull/**', - ], - }, - } - -def publish(ctx): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'publish', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'prepare', - 'image': 'owncloud/alpine:latest', - 'pull': 'always', - 'commands': [ - 'mkdir -p dist', - ], - }, - { - '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], - ], - }, - { - 'name': 'release', - 'image': 'plugins/github-release:1', - 'pull': 'always', - 'settings': { - 'api_key': { - 'from_secret': 'github_token', - }, - 'files': [], - 'title': ctx.build.ref.replace("refs/tags/v", ""), - 'note': 'dist/CHANGELOG.md', - 'overwrite': True, - 'prerelease': len(ctx.build.ref.split("-")) > 1, - }, - }, - ], - 'depends_on': [ - 'testing', - ], - 'trigger': { - 'ref': [ - 'refs/tags/**', - ], - }, - } diff --git a/ocis-reva/.drone.star b/ocis-reva/.drone.star deleted file mode 100644 index 4f933c4c98..0000000000 --- a/ocis-reva/.drone.star +++ /dev/null @@ -1,1051 +0,0 @@ -config = { - 'apiTests': { - 'coreBranch': 'master', - 'coreCommit': 'cb90a3b8bfcddb81f8cf6d84750feaa779105b94', - 'numberOfParts': 4 - } -} - -def main(ctx): - before = testPipelines(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 testPipelines(ctx): - pipelines = [ - testing(ctx), - localApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], 'owncloud'), - localApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], 'ocis') - ] - - for runPart in range(1, config['apiTests']['numberOfParts'] + 1): - pipelines.append(coreApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'], 'owncloud')) - pipelines.append(coreApiTests(ctx, config['apiTests']['coreBranch'], config['apiTests']['coreCommit'], runPart, config['apiTests']['numberOfParts'], 'ocis')) - - return pipelines - -def localApiTests(ctx, coreBranch = 'master', coreCommit = '', storage = 'owncloud'): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'localApiTests-%s-storage' % (storage), - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': - build() + - revaServer(storage) + - cloneCoreRepos(coreBranch, coreCommit) + [ - { - 'name': 'localApiTests-%s-storage' % (storage), - 'image': 'owncloudci/php:7.2', - 'pull': 'always', - 'environment' : { - 'TEST_SERVER_URL': 'http://reva-server:9140', - 'OCIS_REVA_DATA_ROOT': '%s' % ('/srv/app/tmp/reva/' if storage == 'owncloud' else ''), - 'DELETE_USER_DATA_CMD': '%s' % ('rm -rf /srv/app/tmp/reva/data/*' if storage == 'owncloud' else 'rm -rf /srv/app/tmp/ocis/root/nodes/root/*'), - 'SKELETON_DIR': '/srv/app/tmp/testing/data/apiSkeleton', - 'TEST_EXTERNAL_USER_BACKENDS':'true', - 'REVA_LDAP_HOSTNAME':'ldap', - 'TEST_OCIS':'true', - 'BEHAT_FILTER_TAGS': '~@skipOnOcis-%s-Storage' % ('OC' if storage == 'owncloud' else 'OCIS'), - 'PATH_TO_CORE': '/srv/app/testrunner' - }, - 'commands': [ - 'make test-acceptance-api' - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ] - }, - ], - 'services': - ldap() + - redis(), - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -def coreApiTests(ctx, coreBranch = 'master', coreCommit = '', part_number = 1, number_of_parts = 1, storage = 'owncloud'): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'Core-API-Tests-%s-storage-%s' % (storage, part_number), - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': - build() + - revaServer(storage) + - cloneCoreRepos(coreBranch, coreCommit) + [ - { - 'name': 'oC10ApiTests-%s-storage-%s' % (storage, part_number), - 'image': 'owncloudci/php:7.2', - 'pull': 'always', - 'environment' : { - 'TEST_SERVER_URL': 'http://reva-server:9140', - 'OCIS_REVA_DATA_ROOT': '%s' % ('/srv/app/tmp/reva/' if storage == 'owncloud' else ''), - 'DELETE_USER_DATA_CMD': '%s' % ('rm -rf /srv/app/tmp/reva/data/*' if storage == 'owncloud' else 'rm -rf /srv/app/tmp/ocis/root/nodes/root/*'), - 'SKELETON_DIR': '/srv/app/tmp/testing/data/apiSkeleton', - 'TEST_EXTERNAL_USER_BACKENDS':'true', - 'REVA_LDAP_HOSTNAME':'ldap', - 'TEST_OCIS':'true', - 'BEHAT_FILTER_TAGS': '~@notToImplementOnOCIS&&~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@provisioning_api-app-required&&~@preview-extension-required&&~@local_storage', - 'DIVIDE_INTO_NUM_PARTS': number_of_parts, - 'RUN_PART': part_number, - 'EXPECTED_FAILURES_FILE': '/drone/src/tests/acceptance/expected-failures-on-%s-storage.txt' % (storage.upper()) - }, - 'commands': [ - 'cd /srv/app/testrunner', - 'make test-acceptance-api' - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ] - }, - ], - 'services': - ldap() + - redis(), - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } - -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', - }, - }, - }, - { - 'name': 'reva-server', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'detach': True, - 'environment' : { - 'REVA_LDAP_HOSTNAME': 'ldap', - 'REVA_LDAP_PORT': 636, - 'REVA_LDAP_BIND_DN': 'cn=admin,dc=owncloud,dc=com', - 'REVA_LDAP_BIND_PASSWORD': 'admin', - 'REVA_LDAP_BASE_DN': 'dc=owncloud,dc=com', - 'REVA_LDAP_SCHEMA_UID': 'uid', - 'REVA_STORAGE_HOME_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OWNCLOUD_DATADIR': '/srv/app/tmp/reva/data', - 'REVA_STORAGE_OC_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OC_DATA_URL': 'reva-server:9164', - 'REVA_STORAGE_OC_DATA_SERVER_URL': 'http://reva-server:9164/data', - 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', - 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json', - 'REVA_OIDC_ISSUER': 'https://konnectd:9130', - 'REVA_FRONTEND_URL': 'http://reva-server:9140', - 'REVA_DATAGATEWAY_URL': 'http://reva-server:9140/data', - }, - 'commands': [ - 'mkdir -p /srv/app/tmp/reva', - 'bin/ocis-reva --log-level debug --log-pretty gateway &', - 'bin/ocis-reva --log-level debug --log-pretty users &', - 'bin/ocis-reva --log-level debug --log-pretty auth-basic &', - 'bin/ocis-reva --log-level debug --log-pretty auth-bearer &', - 'bin/ocis-reva --log-level debug --log-pretty sharing &', - 'bin/ocis-reva --log-level debug --log-pretty storage-home &', - 'bin/ocis-reva --log-level debug --log-pretty storage-home-data &', - 'bin/ocis-reva --log-level debug --log-pretty storage-oc &', - 'bin/ocis-reva --log-level debug --log-pretty storage-oc-data &', - 'bin/ocis-reva --log-level debug --log-pretty frontend &', - 'bin/ocis-reva --log-level debug --log-pretty reva-storage-public-link' - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ] - }, - { - 'name': 'import-litmus-users', - 'image': 'emeraldsquad/ldapsearch', - 'pull': 'always', - 'commands': [ - 'ldapadd -h ldap -p 389 -D "cn=admin,dc=owncloud,dc=com" -w admin -f ./tests/data/testusers.ldif', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'litmus', - 'image': 'owncloud/litmus:latest', - 'pull': 'always', - 'environment' : { - 'LITMUS_URL': 'http://reva-server:9140/remote.php/webdav', - 'LITMUS_USERNAME': 'tu1', - 'LITMUS_PASSWORD': '1234', - 'TESTS': 'basic http copymove props' - }, - }, - ], - 'services': [ - { - 'name': 'ldap', - 'image': 'osixia/openldap', - 'pull': 'always', - 'environment': { - 'LDAP_DOMAIN': 'owncloud.com', - 'LDAP_ORGANISATION': 'owncloud', - 'LDAP_ADMIN_PASSWORD': 'admin', - 'LDAP_TLS_VERIFY_CLIENT': 'never', - }, - }, - { - 'name': 'redis', - 'image': 'webhippie/redis', - 'pull': 'always', - 'environment': { - 'REDIS_DATABASES': 1 - }, - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - { - 'name': 'config', - 'temp': {}, - }, - { - 'name': 'uploads', - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/**', - ], - }, - } - -def build(): - return [ - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - } - ] - } - ] - -def revaServer(storage): - return [ - { - 'name': 'reva-server', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'detach': True, - 'environment' : { - 'REVA_LDAP_HOSTNAME': 'ldap', - 'REVA_LDAP_PORT': 636, - 'REVA_LDAP_BIND_DN': 'cn=admin,dc=owncloud,dc=com', - 'REVA_LDAP_BIND_PASSWORD': 'admin', - 'REVA_LDAP_BASE_DN': 'dc=owncloud,dc=com', - 'REVA_LDAP_SCHEMA_UID': 'uid', - 'REVA_STORAGE_HOME_DRIVER': '%s' % (storage), - 'REVA_STORAGE_HOME_DATA_DRIVER': '%s' % (storage), - 'REVA_STORAGE_OC_DRIVER': '%s' % (storage), - 'REVA_STORAGE_OC_DATA_DRIVER': '%s' % (storage), - 'REVA_STORAGE_HOME_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OCIS_ROOT': '/srv/app/tmp/ocis/root', - 'REVA_STORAGE_OWNCLOUD_DATADIR': '/srv/app/tmp/reva/data', - 'REVA_STORAGE_OC_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OC_DATA_SERVER_URL': 'http://reva-server:9164/data', - 'REVA_STORAGE_OC_DATA_URL': 'reva-server:9164', - 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', - 'REVA_SHARING_USER_JSON_FILE': '/srv/app/tmp/reva/shares.json', - 'REVA_FRONTEND_URL': 'http://reva-server:9140', - 'REVA_DATAGATEWAY_URL': 'http://reva-server:9140/data', - }, - 'commands': [ - 'apk add mailcap', - 'mkdir -p /srv/app/tmp/reva', - 'mkdir -p /srv/app/tmp/ocis/root/nodes', - 'bin/ocis-reva --log-level debug --log-pretty gateway &', - 'bin/ocis-reva --log-level debug --log-pretty users &', - 'bin/ocis-reva --log-level debug --log-pretty auth-basic &', - 'bin/ocis-reva --log-level debug --log-pretty auth-bearer &', - 'bin/ocis-reva --log-level debug --log-pretty sharing &', - 'bin/ocis-reva --log-level debug --log-pretty storage-home &', - 'bin/ocis-reva --log-level debug --log-pretty storage-home-data &', - 'bin/ocis-reva --log-level debug --log-pretty storage-oc &', - 'bin/ocis-reva --log-level debug --log-pretty storage-oc-data &', - 'bin/ocis-reva --log-level debug --log-pretty frontend &', - 'bin/ocis-reva --log-level debug --log-pretty reva-storage-public-link' - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ] - } - ] - -def cloneCoreRepos(coreBranch, coreCommit): - return [ - { - 'name': 'clone-core-repos', - 'image': 'owncloudci/php:7.2', - 'pull': 'always', - 'commands': [ - 'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/tmp/testing', - 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/core.git /srv/app/testrunner' % (coreBranch), - 'cd /srv/app/testrunner', - ] + ([ - 'git checkout %s' % (coreCommit) - ] if coreCommit != '' else []), - 'volumes': [{ - 'name': 'gopath', - 'path': '/srv/app', - }] - } - ] - -def ldap(): - return [ - { - 'name': 'ldap', - 'image': 'osixia/openldap', - 'pull': 'always', - 'environment': { - 'LDAP_DOMAIN': 'owncloud.com', - 'LDAP_ORGANISATION': 'owncloud', - 'LDAP_ADMIN_PASSWORD': 'admin', - 'LDAP_TLS_VERIFY_CLIENT': 'never', - }, - } - ] - -def redis(): - return [ - { - 'name': 'redis', - 'image': 'webhippie/redis', - 'pull': 'always', - 'environment': { - 'REDIS_DATABASES': 1 - }, - } - ] diff --git a/ocs/.drone.star b/ocs/.drone.star deleted file mode 100644 index a204a15edb..0000000000 --- a/ocs/.drone.star +++ /dev/null @@ -1,698 +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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/proxy/.drone.star b/proxy/.drone.star deleted file mode 100644 index 35ab9d185c..0000000000 --- a/proxy/.drone.star +++ /dev/null @@ -1,698 +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': 'golangci/golangci-lint:latest', - 'pull': 'always', - 'commands': [ - 'golangci-lint run', - ], - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/settings/.drone.star b/settings/.drone.star deleted file mode 100644 index 276a5ffb42..0000000000 --- a/settings/.drone.star +++ /dev/null @@ -1,862 +0,0 @@ -def main(ctx): - before = [ - testing(ctx), - UITests(ctx, 'master', '1840e805bd1bef2e8ee2935de47076a3f2ca3788', 'master', '2e1af4c27f21439ead1e3358f9690e9ffa7eb75a') - ] - - 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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn lint', - 'yarn test', - 'yarn build', - ], - }, - { - 'name': 'generate', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make generate', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'golangci-lint', - 'image': 'golangci/golangci-lint:latest', - 'pull': 'always', - 'commands': [ - 'golangci-lint run', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make protobuf 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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn lint', - 'yarn test', - 'yarn build', - ], - }, - { - '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 protobuf 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', - 'UiTests', - ], - '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': 'frontend', - 'image': 'webhippie/nodejs:latest', - 'pull': 'always', - 'commands': [ - 'yarn install --frozen-lockfile', - 'yarn build', - ], - }, - { - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/**', - ], - }, - } - -def UITests(ctx, ocisBranch, ocisCommitId, phoenixBranch, phoenixCommitId): - return { - 'kind': 'pipeline', - 'type': 'docker', - 'name': 'UiTests', - 'platform': { - 'os': 'linux', - 'arch': 'amd64', - }, - 'steps': [ - { - 'name': 'build', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'make protobuf build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app', - }, - ], - }, - { - 'name': 'build-ocis', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'commands': [ - 'git clone -b %s --single-branch --no-tags https://github.com/owncloud/ocis /srv/app/ocis' % (ocisBranch), - 'cd /srv/app/ocis', - 'git checkout %s' % (ocisCommitId), - 'make build', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app' - }, - ] - }, - { - 'name': 'ocis-server', - 'image': 'webhippie/golang:1.13', - 'pull': 'always', - 'detach': True, - 'environment' : { - 'OCIS_LOG_LEVEL': 'debug', - 'REVA_STORAGE_HOME_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_LOCAL_ROOT': '/srv/app/tmp/reva/root', - 'REVA_STORAGE_OWNCLOUD_DATADIR': '/srv/app/tmp/reva/data', - 'REVA_STORAGE_OC_DATA_TEMP_FOLDER': '/srv/app/tmp/', - 'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379', - 'REVA_LDAP_IDP': 'https://ocis-server:9200', - 'REVA_OIDC_ISSUER': 'https://ocis-server:9200', - 'PROXY_OIDC_ISSUER': 'https://ocis-server:9200', - 'REVA_STORAGE_OC_DATA_SERVER_URL': 'http://ocis-server:9164/data', - 'REVA_DATAGATEWAY_URL': 'https://ocis-server:9200/data', - 'REVA_FRONTEND_URL': 'https://ocis-server:9200', - 'PHOENIX_WEB_CONFIG': '/drone/src/ui/tests/config/drone/ocis-config.json', - 'KONNECTD_IDENTIFIER_REGISTRATION_CONF': '/drone/src/ui/tests/config/drone/identifier-registration.yml', - 'KONNECTD_ISS': 'https://ocis-server:9200', - 'KONNECTD_TLS': 'true', - 'OCIS_CONFIG_FILE': '/drone/src/ui/tests/config/drone/proxy-config.json', - 'SETTINGS_DATA_PATH': '/srv/app/settings-store' - }, - 'commands': [ - 'mkdir -p /srv/app/tmp/reva', - # Start ocis settings first - 'bin/ocis-settings server &', - # Now run all the ocis services except the settings because it is already running - '/srv/app/ocis/bin/ocis server', - ], - 'volumes': [ - { - 'name': 'gopath', - 'path': '/srv/app' - }, - ] - }, - { - 'name': 'WebUIAcceptanceTests', - 'image': 'owncloudci/nodejs:10', - 'pull': 'always', - 'environment': { - 'SERVER_HOST': 'https://ocis-server:9200', - 'BACKEND_HOST': 'https://ocis-server:9200', - 'RUN_ON_OCIS': 'true', - 'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva', - 'OCIS_SKELETON_DIR': '/srv/app/testing/data/webUISkeleton', - 'PHOENIX_CONFIG': '/drone/src/ui/tests/config/drone/ocis-config.json', - 'TEST_TAGS': 'not @skipOnOCIS and not @skip', - 'LOCAL_UPLOAD_DIR': '/uploads', - 'PHOENIX_PATH': '/srv/app/phoenix', - 'FEATURE_PATH': 'ui/tests/acceptance/features', - 'NODE_TLS_REJECT_UNAUTHORIZED': '0', - 'OCIS_SETTINGS_STORE': '/srv/app/settings-store' - }, - 'commands': [ - 'git clone --depth=1 https://github.com/owncloud/testing.git /srv/app/testing', - 'git clone -b %s --single-branch https://github.com/owncloud/phoenix /srv/app/phoenix' % (phoenixBranch), - 'cd /srv/app/phoenix', - 'git checkout %s' % (phoenixCommitId), - 'cp -r /srv/app/phoenix/tests/acceptance/filesForUpload/* /uploads', - 'yarn install-all', - 'yarn dist', - 'cp -r /drone/src/ui/tests/config/drone/ocis-config.json /srv/app/phoenix/dist/config.json', - 'cd /drone/src', - 'yarn install --all', - 'make test-acceptance-webui', - ], - 'volumes': [{ - 'name': 'gopath', - 'path': '/srv/app', - }, - { - 'name': 'uploads', - 'path': '/uploads' - }] - }, - ], - 'services': [ - { - 'name': 'redis', - 'image': 'webhippie/redis', - 'pull': 'always', - 'environment': { - 'REDIS_DATABASES': 1 - }, - }, - { - 'name': 'selenium', - 'image': 'selenium/standalone-chrome-debug:3.141.59-20200326', - 'pull': 'always', - 'volumes': [{ - 'name': 'uploads', - 'path': '/uploads' - }], - }, - ], - 'volumes': [ - { - 'name': 'gopath', - 'temp': {}, - }, - { - 'name': 'uploads', - 'temp': {} - } - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/tags/**', - 'refs/pull/**', - ], - }, - } diff --git a/store/.drone.star b/store/.drone.star deleted file mode 100644 index e439f9d9be..0000000000 --- a/store/.drone.star +++ /dev/null @@ -1,677 +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': 'lint', - 'image': 'golangci/golangci-lint:v1.26', - 'commands': [ - 'golangci-lint run --timeout 2m0s', - ], - }, - { - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/thumbnails/.drone.star b/thumbnails/.drone.star deleted file mode 100644 index f39ff5feff..0000000000 --- a/thumbnails/.drone.star +++ /dev/null @@ -1,711 +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', - }, - }, - }, - { - 'name': 'sonarcloud', - 'image': 'sonarsource/sonar-scanner-cli', - 'pull': 'always', - 'environment': { - 'SONAR_TOKEN': { - 'from_secret': 'sonar_token', - }, - 'SONAR_PULL_REQUEST_BASE': 'master' if ctx.build.event == 'pull_request' else None, - 'SONAR_PULL_REQUEST_BRANCH': ctx.build.source if ctx.build.event == 'pull_request' else None, - 'SONAR_PULL_REQUEST_KEY': ctx.build.ref.replace("refs/pull/", "").split("/")[0] if ctx.build.event == 'pull_request' else None, - }, - }, - ], - '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': 'webhippie/golang:1.13', - '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 docs-copy' - ], - }, - { - 'name': 'test', - 'image': 'webhippie/hugo:latest', - 'commands': [ - 'cd hugo', - 'hugo', - ], - }, - { - 'name': 'list', - 'image': 'owncloudci/alpine:latest', - 'commands': [ - 'tree hugo/public', - ], - }, - { - '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/webdav/.drone.star b/webdav/.drone.star deleted file mode 100644 index c1bba64194..0000000000 --- a/webdav/.drone.star +++ /dev/null @@ -1,654 +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/", ""), - 'note': 'dist/CHANGELOG.md', - 'overwrite': True, - }, - '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): - 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' % (ctx.repo.slug), - 'branch': ctx.build.branch 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': 'output', - 'image': 'webhippie/golang:1.13', - '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/tags/**', - ], - }, - } - -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': 'generate', - 'image': 'webhippie/hugo:latest', - 'pull': 'always', - 'commands': [ - 'make docs', - ], - }, - { - 'name': 'publish', - 'image': 'plugins/gh-pages:1', - 'pull': 'always', - 'settings': { - 'username': { - 'from_secret': 'github_username', - }, - 'password': { - 'from_secret': 'github_token', - }, - 'pages_directory': 'docs/public/', - 'temporary_base': 'tmp/', - }, - 'when': { - 'ref': { - 'exclude': [ - 'refs/pull/**', - ], - }, - }, - }, - ], - 'depends_on': [ - 'badges', - ], - 'trigger': { - 'ref': [ - 'refs/heads/master', - 'refs/pull/**', - ], - }, - }