Skip to content

Commit

Permalink
Use different Template for GH Releases
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Jan 15, 2020
1 parent 741ae15 commit f4d05dd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 49 deletions.
63 changes: 14 additions & 49 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main(ctx):

dependsOn(before, stages)

after = afterPipelines()
after = afterPipelines(ctx)
dependsOn(stages, after)

return before + stages + after
Expand All @@ -93,16 +93,13 @@ def beforePipelines(ctx):

def stagePipelines(ctx):
acceptancePipelines = acceptance()
buildPipelines = build(ctx)
if (acceptancePipelines == False) or (buildPipelines == False):
if acceptancePipelines == False:
return False

return acceptancePipelines + buildPipelines
return acceptancePipelines

def afterPipelines():
return [
notify()
]
def afterPipelines(ctx):
return build(ctx) + notify()

def yarnlint():
pipelines = []
Expand Down Expand Up @@ -401,6 +398,8 @@ def acceptance():
return pipelines

def notify():
pipelines = []

result = {
'kind': 'pipeline',
'type': 'docker',
Expand Down Expand Up @@ -436,7 +435,9 @@ def notify():
for branch in config['branches']:
result['trigger']['ref'].append('refs/heads/%s' % branch)

return result
pipelines.append(result)

return pipelines

def databaseServiceForFederation(db, suffix):
dbName = getDbName(db)
Expand Down Expand Up @@ -753,41 +754,10 @@ def buildDockerImage():
}]

def buildRelease(ctx):
<<<<<<< HEAD
return [{
'name': 'build-release',
'image': 'owncloudci/nodejs:10',
'pull': 'always',
'commands': [
'cd /var/www/owncloud/phoenix',
'make -f Makefile.release dist'
],
},{
'name': 'release-to-github',
'image': 'plugins/github-release:1',
'pull': 'always',
'settings': {
'api_key': {
'from_secret': 'github_token',
},
'files': [
'release/*',
],
'title': ctx.build.ref.replace("refs/tags/", ""),
'note': '# Changelog\nhttps://github.com/owncloud/phoenix/blob/master/CHANGELOG.md',
'overwrite': True,
},
'when': {
'ref': [
'refs/tags/**',
],
},
}]
=======
return [
{
'name': 'build-release',
'image': 'owncloudci/php:7.1',
'image': 'owncloudci/nodejs:10',
'pull': 'always',
'commands': [
'cd /var/www/owncloud/phoenix',
Expand All @@ -799,7 +769,7 @@ def buildRelease(ctx):
'image': 'toolhippie/calens:latest',
'pull': 'always',
'commands': [
'calens --version %s -o dist/CHANGELOG.md' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
'calens --version %s -o dist/CHANGELOG.md -t changelog/CHANGELOG-Release.tmpl' % ctx.build.ref.replace("refs/tags/v", "").split("-")[0],
],
'when': {
'ref': [
Expand All @@ -822,7 +792,7 @@ def buildRelease(ctx):
'md5',
'sha256'
],
'title': ctx.build.ref.replace("refs/tags/", ""),
'title': ctx.build.ref.replace("refs/tags/v", ""),
'note': 'dist/CHANGELOG.md',
'overwrite': True,
},
Expand All @@ -831,13 +801,8 @@ def buildRelease(ctx):
'refs/tags/**',
],
}
},
<<<<<<< HEAD
]
>>>>>>> Add calens changelog generator
=======
}
]
>>>>>>> Add calens changelog generator

def deployStaging():
return [{
Expand Down
28 changes: 28 additions & 0 deletions changelog/CHANGELOG-Release.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- range $index, $changes := . }}{{ with $changes -}}
Changelog for ownCloud Phoenix {{ .Version }} ({{ .Date }})
=======

Summary
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .Type }} - {{ .Title }}: [#{{ .PrimaryID }}]({{ .PrimaryURL }})
{{- end }}{{ end }}

Details
-------
{{ range $entry := .Entries }}{{ with $entry }}
* {{ .Type }} - {{ .Title }}: [#{{ .PrimaryID }}]({{ .PrimaryURL }})
{{ range $par := .Paragraphs }}
{{ wrapIndent $par 80 3 }}
{{ end -}}
{{ range $url := .IssueURLs }}
{{ $url -}}
{{ end -}}
{{ range $url := .PRURLs }}
{{ $url -}}
{{ end -}}
{{ range $url := .OtherURLs }}
{{ $url -}}
{{ end }}
{{ end }}{{ end }}
{{ end }}{{ end -}}

0 comments on commit f4d05dd

Please sign in to comment.