Switch to pure starlark drone config

This commit is contained in:
Thomas Boerger
2019-11-06 10:12:23 +01:00
parent 2ce8986765
commit e3eabde117
3 changed files with 631 additions and 1176 deletions

631
.drone.star Normal file
View File

@@ -0,0 +1,631 @@
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',
},
'steps': [
{
'name': 'generate',
'image': 'toolhippie/calens:latest',
'pull': 'always',
'commands': [
'make changelog',
],
},
{
'name': 'output',
'image': 'toolhippie/calens: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/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/**',
],
},
}

View File

@@ -1,480 +0,0 @@
def main(ctx):
before = testing()
stages = [
docker('amd64'),
docker('arm64'),
docker('arm'),
binary('linux'),
binary('darwin'),
binary('windows'),
]
after = [
manifest(),
documentation()
]
for b in before:
for s in stages:
s['depends_on'].append(b['name'])
for s in stages:
for a in after:
a['depends_on'].append(s['name'])
return before + stages + after
def testing():
return [{
'kind': 'pipeline',
'type': 'docker',
'name': 'testing',
'platform': {
'os': 'linux',
'arch': 'amd64',
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make generate'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'vet',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make vet'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'staticcheck',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make staticcheck'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'lint',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make lint'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'build',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make build'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'test',
'image': 'webhippie/golang:1.12',
'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(arch):
return {
'kind': 'pipeline',
'type': 'docker',
'name': arch,
'platform': {
'os': 'linux',
'arch': arch,
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make generate'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'build',
'image': 'webhippie/golang:1.12',
'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,
'auto_tag_suffix': 'linux-%s' % arch,
'dockerfile': 'docker/Dockerfile.linux.%s' % arch,
'repo': 'owncloud/ocis-ocs',
},
'when': {
'event': [
'pull_request'
]
}
},
{
'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': 'owncloud/ocis-ocs',
},
'when': {
'event': {
'exclude': [
'pull_request'
]
}
}
},
],
'volumes': [
{
'name': 'gopath',
'temp': {}
}
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/tags/**',
'refs/pull/**'
]
}
}
def binary(name):
return {
'kind': 'pipeline',
'type': 'docker',
'name': name,
'platform': {
'os': 'linux',
'arch': 'amd64',
},
'steps': [
{
'name': 'generate',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make generate'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'build',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make release-%s' % name
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'finish',
'image': 'webhippie/golang:1.12',
'pull': 'always',
'commands': [
'make release-finish'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
}
]
},
{
'name': 'upload-push',
'image': 'plugins/s3:1',
'pull': 'always',
'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/ocs/testing'
},
'when': {
'event': [
'push'
]
}
},
{
'name': 'upload-tag',
'image': 'plugins/s3:1',
'pull': 'always',
'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/ocs/${DRONE_TAG##v}'
},
'when': {
'event': [
'tag'
]
}
},
{
'name': 'github-release',
'image': 'plugins/github-release:1',
'pull': 'always',
'settings': {
'api_key': {
'from_secret': 'github_token'
},
'files': [
'dist/release/*'
],
'title': '${DRONE_TAG}',
'note': 'You can find the detailed changelog at https://github.com/owncloud/ocis-ocs/blob/master/CHANGELOG.md',
'overwrite': True
},
'when': {
'event': [
'tag'
]
}
}
],
'volumes': [
{
'name': 'gopath',
'temp': {}
}
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/tags/**',
'refs/pull/**'
]
}
}
def manifest():
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'manifest',
'steps': [
{
'name': 'manifest',
'image': 'plugins/manifest',
'pull': 'always',
'settings': {
'username': {
'from_secret': 'docker_username'
},
'password': {
'from_secret': 'docker_password'
},
'spec': 'docker/manifest.tmpl',
'auto_tag': 'true',
'ignore_missing': 'true',
},
},
{
'name': 'microbadger',
'image': 'plugins/webhook',
'pull': 'always',
'settings': {
'urls': {
'from_secret': 'microbadger_url'
}
},
}
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/tags/**'
]
}
}
def documentation():
return {
'kind': 'pipeline',
'type': 'docker',
'name': 'documentation',
'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': {
'event': {
'exclude': [
'pull_request'
]
}
}
}
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/pull/**'
]
}
}

View File

@@ -1,696 +0,0 @@
---
kind: pipeline
type: docker
name: testing
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: vet
pull: always
image: webhippie/golang:1.12
commands:
- make vet
volumes:
- name: gopath
path: /srv/app
- name: staticcheck
pull: always
image: webhippie/golang:1.12
commands:
- make staticcheck
volumes:
- name: gopath
path: /srv/app
- name: lint
pull: always
image: webhippie/golang:1.12
commands:
- make lint
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make build
volumes:
- name: gopath
path: /srv/app
- name: test
pull: always
image: webhippie/golang:1.12
commands:
- make test
volumes:
- name: gopath
path: /srv/app
- name: codacy
pull: always
image: plugins/codacy:1
settings:
token:
from_secret: codacy_token
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
---
kind: pipeline
type: docker
name: amd64
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make build
volumes:
- name: gopath
path: /srv/app
- name: dryrun
pull: always
image: plugins/docker:18.09
settings:
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
dry_run: true
repo: owncloud/ocis-ocs
tags: linux-amd64
when:
event:
- pull_request
- name: docker
pull: always
image: plugins/docker:18.09
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
password:
from_secret: docker_password
repo: owncloud/ocis-ocs
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: arm64
platform:
os: linux
arch: arm64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make build
volumes:
- name: gopath
path: /srv/app
- name: dryrun
pull: always
image: plugins/docker:18.09
settings:
auto_tag_suffix: linux-arm64
dockerfile: docker/Dockerfile.linux.arm64
dry_run: true
repo: owncloud/ocis-ocs
tags: linux-arm64
when:
event:
- pull_request
- name: docker
pull: always
image: plugins/docker:18.09
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
dockerfile: docker/Dockerfile.linux.arm64
password:
from_secret: docker_password
repo: owncloud/ocis-ocs
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: arm
platform:
os: linux
arch: arm
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make build
volumes:
- name: gopath
path: /srv/app
- name: dryrun
pull: always
image: plugins/docker:18.09
settings:
auto_tag_suffix: linux-arm
dockerfile: docker/Dockerfile.linux.arm
dry_run: true
repo: owncloud/ocis-ocs
tags: linux-arm
when:
event:
- pull_request
- name: docker
pull: always
image: plugins/docker:18.09
settings:
auto_tag: true
auto_tag_suffix: linux-arm
dockerfile: docker/Dockerfile.linux.arm
password:
from_secret: docker_password
repo: owncloud/ocis-ocs
username:
from_secret: docker_username
when:
event:
exclude:
- pull_request
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: linux
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make release-linux
volumes:
- name: gopath
path: /srv/app
- name: finish
pull: always
image: webhippie/golang:1.12
commands:
- make release-finish
volumes:
- name: gopath
path: /srv/app
- name: upload-push
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/testing
when:
event:
- push
- name: upload-tag
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/${DRONE_TAG##v}
when:
event:
- tag
- name: github-release
pull: always
image: plugins/github-release:1
settings:
api_key:
from_secret: github_token
files:
- dist/release/*
note: You can find the detailed changelog at https://github.com/owncloud/ocis-ocs/blob/master/CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
event:
- tag
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: darwin
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make release-darwin
volumes:
- name: gopath
path: /srv/app
- name: finish
pull: always
image: webhippie/golang:1.12
commands:
- make release-finish
volumes:
- name: gopath
path: /srv/app
- name: upload-push
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/testing
when:
event:
- push
- name: upload-tag
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/${DRONE_TAG##v}
when:
event:
- tag
- name: github-release
pull: always
image: plugins/github-release:1
settings:
api_key:
from_secret: github_token
files:
- dist/release/*
note: You can find the detailed changelog at https://github.com/owncloud/ocis-ocs/blob/master/CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
event:
- tag
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: windows
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/golang:1.12
commands:
- make generate
volumes:
- name: gopath
path: /srv/app
- name: build
pull: always
image: webhippie/golang:1.12
commands:
- make release-windows
volumes:
- name: gopath
path: /srv/app
- name: finish
pull: always
image: webhippie/golang:1.12
commands:
- make release-finish
volumes:
- name: gopath
path: /srv/app
- name: upload-push
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/testing
when:
event:
- push
- name: upload-tag
pull: always
image: plugins/s3:1
settings:
access_key:
from_secret: aws_access_key_id
bucket:
from_secret: s3_bucket
endpoint:
from_secret: s3_endpoint
path_style: true
secret_key:
from_secret: aws_secret_access_key
source: dist/release/*
strip_prefix: dist/release/
target: /ocis/ocs/${DRONE_TAG##v}
when:
event:
- tag
- name: github-release
pull: always
image: plugins/github-release:1
settings:
api_key:
from_secret: github_token
files:
- dist/release/*
note: You can find the detailed changelog at https://github.com/owncloud/ocis-ocs/blob/master/CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
event:
- tag
volumes:
- name: gopath
temp: {}
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- testing
---
kind: pipeline
type: docker
name: manifest
platform:
os: linux
arch: amd64
steps:
- name: manifest
pull: always
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
password:
from_secret: docker_password
spec: docker/manifest.tmpl
username:
from_secret: docker_username
- name: microbadger
pull: always
image: plugins/webhook
settings:
urls:
from_secret: microbadger_url
trigger:
ref:
- refs/heads/master
- refs/tags/**
depends_on:
- amd64
- arm64
- arm
- linux
- darwin
- windows
---
kind: pipeline
type: docker
name: documentation
platform:
os: linux
arch: amd64
steps:
- name: generate
pull: always
image: webhippie/hugo:latest
commands:
- make docs
- name: publish
pull: always
image: plugins/gh-pages:1
settings:
pages_directory: docs/public/
password:
from_secret: github_token
temporary_base: tmp/
username:
from_secret: github_username
when:
event:
exclude:
- pull_request
trigger:
ref:
- refs/heads/master
- refs/pull/**
depends_on:
- amd64
- arm64
- arm
- linux
- darwin
- windows
...