versionbot: Add changelog yml file
This file allows other components to uniquely parse the information that is contained in the changelog. It will be automatically managed by versionist by appending the new commits on top. This is needed to provide nested-changelogs. Change-type: patch Signed-off-by: Giovanni Garufi <giovanni@resin.io> Changelog-entry: Add a parsable representation of the changelog
This commit is contained in:
parent
99d58d9389
commit
dd5f2da3d2
4 changed files with 121 additions and 110 deletions
115
.versionbot/CHANGELOG.yml
Normal file
115
.versionbot/CHANGELOG.yml
Normal file
|
@ -0,0 +1,115 @@
|
|||
- version: 2.14.3+rev3
|
||||
date: 2018-09-25T22:00:00.000Z
|
||||
commits:
|
||||
- subject: >-
|
||||
Update the poky submodule to sumo-19.0.1 [Florin Sarbu]
|
||||
- version: 2.14.3+rev2
|
||||
date: 2018-09-09T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Add new style docs links for NanoPi Neo Air [Florin Sarbu]'
|
||||
- subject: >-
|
||||
Use nanopi-neo-air.conf machine definition from the BSP layer [Florin
|
||||
Sarbu]
|
||||
- subject: >-
|
||||
Set PREFERRED_VERSION linux-mainline to 4.17.3 for bananapi-m1-plus
|
||||
[Florin Sarbu]
|
||||
- subject: 'Clean-up swap, conf-notes.txt and obsolete kernel recipes [Florin Sarbu]'
|
||||
- subject: 'Add LAYERSERIES_COMPAT to yocto in layer.conf [Florin Sarbu]'
|
||||
- subject: 'Add versionist support [Giovanni Garufi]'
|
||||
- version: 2.14.3+rev1
|
||||
date: 2018-08-13T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.14.3 [Florin]'
|
||||
- subject: 'Switch to Yocto Sumo 19.0.0 [Florin]'
|
||||
- version: 2.14.0+rev3
|
||||
date: 2018-07-26T22:00:00.000Z
|
||||
commits:
|
||||
- subject: >-
|
||||
linux-mainline: Enable CONFIG_USB_SERIAL_OPTION necessary for modems
|
||||
functionality [Sebastian]
|
||||
- version: 2.14.0+rev2
|
||||
date: 2018-07-25T22:00:00.000Z
|
||||
commits:
|
||||
- subject: >-
|
||||
linux-mainline: Enable drivers for CP210x usb-serial converters
|
||||
[Sebastian]
|
||||
- subject: 'linux-mainline: Enable drivers for Huawei modems [Sebastian]'
|
||||
- subject: >-
|
||||
Update the resin-yocto-scripts submodule to
|
||||
8312741e13604a9d166370349061876afb22c0fa [Sebastian]
|
||||
- version: 2.14.0+rev1
|
||||
date: 2018-07-17T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.14.0 [Florin]'
|
||||
- version: 2.13.6+rev1
|
||||
date: 2018-07-12T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.13.6 [Sebastian]'
|
||||
- subject: 'linux-mainline: Revert "random: fix crng_ready() test" patch [Sebastian]'
|
||||
- subject: 'coffeescript: Add instructions for flashing OrangePi Plus2 [Thodoris]'
|
||||
- version: 2.13.5+rev1
|
||||
date: 2018-07-08T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.13.5 [Sebastian]'
|
||||
- subject: >-
|
||||
Update the resin-yocto-scripts submodule to
|
||||
59ccd8558435ff6424827fb36ccb43b14650f4d4 [Sebastian]
|
||||
- version: 2.13.3+rev1
|
||||
date: 2018-07-03T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update meta-resin submodule to version 2.13.3 [Sebastian]'
|
||||
- subject: >-
|
||||
linux-mainline: Update kernel to 4.17.3 version for OrangePi Plus2
|
||||
[Sebastian]
|
||||
- subject: >-
|
||||
linux-mainline: Activate USB_SERIAL_PL2303 kernel module for
|
||||
OrangePi-Plus2 [Sebastian]
|
||||
- subject: 'linux-mainline: Enable i2c0 in OrangePi-Plus2 device tree [Sebastian]'
|
||||
- version: 2.12.7+rev3
|
||||
date: 2018-05-22T22:00:00.000Z
|
||||
commits:
|
||||
- subject: >-
|
||||
packagegroup-resin-connectivity: Add necessary firmware for WiFi
|
||||
[Sebastian]
|
||||
- version: 2.12.7+rev2
|
||||
date: 2018-05-15T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'hostapp-update-hooks: Fix bootloader update hook [Sebastian]'
|
||||
- version: 2.12.7+rev1
|
||||
date: 2018-05-10T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.12.7 [Sebastian]'
|
||||
- subject: 'Add support for the OrangePi Plus2 device [Sebastian]'
|
||||
- version: 2.12.6+rev1
|
||||
date: 2018-05-01T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update the meta-resin submodule to version v2.12.6 [Florin]'
|
||||
- version: 2.12.5+rev4
|
||||
date: 2018-04-12T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Use correct deploy artifact name in coffescript [Sebastian]'
|
||||
- subject: 'Use native python as u-boot tool [Sebastian]'
|
||||
- subject: >-
|
||||
Update resin-yocto-scripts to f7718efbbf53369aaacb7eb54e707ee8a5d4fc4b
|
||||
[Sebastian]
|
||||
- version: 2.12.5+rev3
|
||||
date: 2018-03-29T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Remove oe-meta-go layer from .gitmodules [Sebastian]'
|
||||
- version: 2.12.5+rev2
|
||||
date: 2018-03-29T22:00:00.000Z
|
||||
commits:
|
||||
- subject: >-
|
||||
Update resin-yocto-scripts to 9cecb1ca4d9d4713dd337148b7d04a17afdba772
|
||||
[Sebastian]
|
||||
- version: 2.12.5+rev1
|
||||
date: 2018-03-25T22:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Update meta-resin submodule to version v2.12.5 [Sebastian]'
|
||||
- subject: >-
|
||||
Update resin-yocto-scripts to 51b8849e2a02d0d4e729bff24909d9746e0bf4c3
|
||||
[Sebastian]
|
||||
- version: 2.12.3+rev1
|
||||
date: 2018-03-20T23:00:00.000Z
|
||||
commits:
|
||||
- subject: 'Add support for BananaPi-M1+ boards [Sebastian]'
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"lodash": "^4.17.10",
|
||||
"semver": "^5.5.1",
|
||||
"shelljs": "^0.8.2"
|
||||
}
|
||||
}
|
6
repo.yml
Normal file
6
repo.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
type: 'yocto-based OS image'
|
||||
reviewers: 1
|
||||
upstream:
|
||||
repo: 'meta-resin'
|
||||
url: 'http://github.com/resin-os/meta-resin'
|
|
@ -1,102 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
const _ = require('lodash')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const semver = require('semver')
|
||||
const shell = require('shelljs')
|
||||
|
||||
const getAuthor = (commitHash) => {
|
||||
const authorCmd = shell.exec(`git show --quiet --format="%an" ${commitHash}`)
|
||||
if (authorCmd.code !== 0) {
|
||||
throw new Error(authorCmd.stderr)
|
||||
}
|
||||
return authorCmd.stdout.replace('\n', '')
|
||||
}
|
||||
|
||||
const compareExtendedSemver = (a, b) => {
|
||||
const semverCompare = semver.compare(a, b)
|
||||
if (semverCompare !== 0) {
|
||||
return semverCompare
|
||||
}
|
||||
return a.localeCompare(b)
|
||||
}
|
||||
|
||||
const getMetaResinFromSubmodule = (documentedVersions, history, callback) => {
|
||||
shell.exec('git submodule status layers/meta-resin', (code, stdout, stderr) => {
|
||||
if (code != 0) {
|
||||
return callback(new Error('Could not find meta-resin submodule'))
|
||||
}
|
||||
const match = /.{40} .* \(v(.+)\)/.exec(stdout)
|
||||
|
||||
if (!match) {
|
||||
return callback(new Error(`Could not determine meta-resin version from version ${stdout}`))
|
||||
}
|
||||
|
||||
const metaVersion = `${match[1]}+rev0`
|
||||
const latestDocumented = _.trim(_.last(documentedVersions.sort(compareExtendedSemver)))
|
||||
|
||||
// semver.gt will ignore the revision numbers but still compare the version
|
||||
// If metaVersion <= latestDocumented then the latestDocumented version is a revision of the current metaVersion
|
||||
const latestVersion = semver.gt(metaVersion, latestDocumented) ? metaVersion : latestDocumented
|
||||
|
||||
return callback(null, latestVersion)
|
||||
})
|
||||
}
|
||||
|
||||
const updateVersionFile = (cwd, version, callback) => {
|
||||
const versionFile = path.join(cwd, 'VERSION')
|
||||
|
||||
fs.writeFile(versionFile, version, callback)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
addEntryToChangelog: {
|
||||
preset: 'prepend',
|
||||
fromLine: 3
|
||||
},
|
||||
getChangelogDocumentedVersions: {
|
||||
preset: 'changelog-headers',
|
||||
clean: /^v/
|
||||
},
|
||||
getGitReferenceFromVersion: 'v-prefix',
|
||||
includeCommitWhen: (commit) => {
|
||||
return commit.footer['changelog-entry']
|
||||
},
|
||||
getIncrementLevelFromCommit: (commit) => {
|
||||
return 'patch'
|
||||
},
|
||||
incrementVersion: (currentVersion, incrementLevel) => {
|
||||
const revision = Number(currentVersion[currentVersion.length - 1])
|
||||
if (!_.isFinite(revision)) {
|
||||
throw new Error(`Could not extract revision number from ${currentVersion}`)
|
||||
}
|
||||
return currentVersion.slice(0, currentVersion.length - 1) + (revision + 1)
|
||||
},
|
||||
getCurrentBaseVersion: getMetaResinFromSubmodule,
|
||||
updateVersion: updateVersionFile,
|
||||
// If a 'changelog-entry' tag is found, use this as the subject rather than the
|
||||
// first line of the commit.
|
||||
transformTemplateData: (data) => {
|
||||
data.commits.forEach((commit) => {
|
||||
commit.subject = commit.footer['changelog-entry'] || commit.subject
|
||||
commit.author = getAuthor(commit.hash)
|
||||
});
|
||||
if (_.isEmpty(data.commits)) {
|
||||
throw new Error('At least one commit must be annotated with a Changelog-entry tag')
|
||||
}
|
||||
return data;
|
||||
},
|
||||
template: [
|
||||
'# v{{version}}',
|
||||
'## ({{moment date "Y-MM-DD"}})',
|
||||
'',
|
||||
'{{#each commits}}',
|
||||
'{{#if this.author}}',
|
||||
'* {{capitalize this.subject}} [{{this.author}}]',
|
||||
'{{else}}',
|
||||
'* {{capitalize this.subject}}',
|
||||
'{{/if}}',
|
||||
'{{/each}}'
|
||||
].join('\n')
|
||||
}
|
Loading…
Add table
Reference in a new issue