Skip to content

Commit

Permalink
[CI] changelog follow ups (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Oct 28, 2020
1 parent 43b77aa commit a8539bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 6 additions & 1 deletion .ci/.grenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ module.exports = {
"username": "elastic",
"repo": "apm-agent-php",
"dataSource": "prs",
"ignoreIssuesWith": [
"automation",
"ci",
"developer only"
],
"groupBy": {
"Breaking changes": ["breaking"],
"Bug fixes": ["bug", "fix"],
"Features": ["enhancement", "internal", "feature", "feat"]
"Features": ["enhancement", "feature", "feat"]
},
"template": {
issue: function (placeholders) {
Expand Down
16 changes: 8 additions & 8 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -493,25 +493,25 @@ def notifyStatus(def args = [:]) {

def prepareRelease() {
def tagName = "v${params.VERSION}"
def branchName = "prepare-release-${tagName}"
def branchName = "prepare-release-${tagName}-${env.BUILD_NUMBER}"
def message = "[${params.VERSION}] Bump version and create changelog"
def warning = """> THIS PR IS AUTOMATICALLY GENERATED BY RELEASE PIPELINE."""
def actions = """### Actions
* If changes are fine then:
1. [aprove](${env.BUILD_URL}input) it. The pipeline will take care of the release.
1. [Approve](${env.BUILD_URL}input) it. The pipeline will take care of the release.
1. Close this PR since it's not required anymore.
1. Delete branch `${branchName}`.
1. Delete branch ${branchName}.
* If changes are not correct then:
1. [abort](${env.BUILD_URL}input) it
1. Change and commit changes to this PR.
1. Merge this PR.
1. Delete branch `${branchName}`.
1. Run release [build](${env.JOB_URL}) with the `VERSION` parameter = `${params.VERSION}`"""
1. Delete branch ${branchName}.
1. Run release [build](${env.JOB_URL}) with the VERSION parameter = ${params.VERSION}"""
def previousVersion = sh(label: 'Get previous version', script: 'make -f .ci/Makefile previous-version', returnStdout: true).trim()
sh label: 'Bump version', script: "VERSION=${params.VERSION} BRANCH_NAME=${env.BRANCH_NAME} make -f .ci/Makefile bump-version"
if (sh(label: 'Compare version', script: 'git diff-index --quiet HEAD --', returnStatus: true) > 0) {
// Change current pointer to be used for generating the changelog
gitCreateTag(tag: 'current', tagArgs: '--force', pushArgs: '--force')
if (sh(label: 'is version bumped?', script: 'git diff-index --quiet HEAD --', returnStatus: true) > 0) {
// Change ci-tag pointer to be used for generating the changelog
gitCreateTag(tag: 'ci-tag', tagArgs: '--force', pushArgs: '--force')
// Create Changelog and verify it contains what's expected.
sh(label: 'Create changelog', script: "GITHUB_TOKEN=${GITHUB_TOKEN} TAG_NAME=${tagName} PREVIOUS_TAG=v${previousVersion} make -f .ci/Makefile prepare-changelog changelog")
sh(label: "Git branch ${branchName}", script: """git checkout -b ${branchName}""")
Expand Down
2 changes: 1 addition & 1 deletion .ci/docker/gren/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mkdir -p build || true

/usr/local/bin/gren changelog \
--token="${GITHUB_TOKEN}" \
--tags="current..${PREVIOUS_TAG}" \
--tags="ci-tag..${PREVIOUS_TAG}" \
--generate \
--override \
--config .ci/.grenrc.js \
Expand Down

0 comments on commit a8539bc

Please sign in to comment.