Skip to content

Commit

Permalink
Add calens changelog generator
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Jan 14, 2020
1 parent 6784863 commit 753d490
Showing 1 changed file with 109 additions and 110 deletions.
219 changes: 109 additions & 110 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def build(ctx):
'ref': [
'refs/merge-requests/**',
'refs/heads/master',
'refs/tags/**',
'refs/tags/**',
]
}
}
Expand All @@ -181,104 +181,103 @@ def build(ctx):
return pipelines

def changelog(ctx):
pipelines = []

result = {
'kind': 'pipeline',
'type': 'docker',
'name': 'changelog',
'clone': {
'disable': True,
},
'steps':
[
{
'name': 'clone',
'image': 'plugins/git-action:1',
'pull': 'always',
'settings': {
'actions': [
'clone',
pipelines = []

result = {
'kind': 'pipeline',
'type': 'docker',
'name': 'changelog',
'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.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': 'toolhippie/calens:latest',
'pull': 'always',
'commands': [
'calens >| CHANGELOG.md',
],
},
{
'name': 'diff',
'image': 'owncloud/alpine:latest',
'pull': 'always',
'commands': [
'git diff',
],
},
{
'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': '[email protected]',
'author_name': 'ownClouders',
'netrc_machine': 'github.com',
'netrc_username': {
'from_secret': 'github_username',
},
'netrc_password': {
'from_secret': 'github_token',
},
},
'when': {
'ref': {
'exclude': [
'refs/pull/**',
'refs/tags/**'
],
'remote': 'https://github.com/%s' % (ctx.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': 'toolhippie/calens:latest',
'pull': 'always',
'commands': [
'calens >| CHANGELOG.md',
],
},
{
'name': 'diff',
'image': 'owncloud/alpine:latest',
'pull': 'always',
'commands': [
'git diff',
],
},
{
'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': '[email protected]',
'author_name': 'ownClouders',
'netrc_machine': 'github.com',
'netrc_username': {
'from_secret': 'github_username',
},
'netrc_password': {
'from_secret': 'github_token',
},
},
'when': {
'ref': {
'exclude': [
'refs/pull/**',
'refs/tags/**'
],
},
},
},
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/pull/**',
],
},
}

pipelines.append(result)

return pipelines
},
],
'depends_on': [],
'trigger': {
'ref': [
'refs/heads/master',
'refs/pull/**',
],
},
}

pipelines.append(result)

return pipelines

def acceptance():
pipelines = []
Expand Down Expand Up @@ -733,19 +732,19 @@ def buildPhoenix():

def buildDockerImage():
return [{
'name': 'docker',
'image': 'plugins/docker:18.09',
'pull': 'always',
'settings': {
'username': {
'from_secret': 'docker_username',
},
'password': {
'from_secret': 'docker_password',
},
'auto_tag': True,
'repo': 'owncloud/phoenix',
},
'name': 'docker',
'image': 'plugins/docker:18.09',
'pull': 'always',
'settings': {
'username': {
'from_secret': 'docker_username',
},
'password': {
'from_secret': 'docker_password',
},
'auto_tag': True,
'repo': 'owncloud/phoenix',
},
'when': {
'event': [
'push'
Expand Down Expand Up @@ -802,7 +801,7 @@ def buildRelease(ctx):
],
}
},
]
]

def deployStaging():
return [{
Expand Down

0 comments on commit 753d490

Please sign in to comment.