diff --git a/bin/changelog b/bin/changelog new file mode 100755 index 0000000..a5a4a40 --- /dev/null +++ b/bin/changelog @@ -0,0 +1,70 @@ +#!/usr/bin/env node +'use strict'; + +/* + * This script generates the template a changelog by comparing a current version + * with master. Run this, copy what's logged into the `CHANGELOG.md` and update + * the top section based on the changes listed in "Community Contributions" + * + * Usage: + * + * bin/changelog + */ + +var EOL = require('os').EOL; +var Promise = require('ember-cli/lib/ext/promise'); +var GitHubApi = require('github'); + +var github = new GitHubApi({version: '3.0.0'}); +var compareCommits = Promise.denodeify(github.repos.compareCommits); +var currentVersion = 'v' + require('../package').version; + +compareCommits({ + user: 'levelbossmike', + repo: 'ember-deploy-redis', + base: currentVersion, + head: 'master' +}).then(function(res) { + return res.commits.map(function(commitInfo) { + return commitInfo.commit.message + + }).filter(function(message) { + return message.indexOf('Merge pull request #') > -1; + + }).map(function(message) { + var numAndAuthor = message.match(/#(\d+) from (.*)\//).slice(1,3); + var title = message.split('\n\n')[1]; + + return { + number: +numAndAuthor[0], + author: numAndAuthor[1], + title: title + }; + + }).sort(function(a, b) { + return a.number > b.number; + }).map(function(pr) { + var link = '[#' + pr.number + ']' + + '(https://github.com/levelbossmike/ember-deploy-redis/pull/' + pr.number + ')'; + var title = pr.title; + var author = '[@' + pr.author + ']' + + '(https://github.com/' + pr.author +')'; + + return '- ' + link + ' ' + title + ' ' + author; + + }).join('\n'); + +}).then(function(contributions) { + var changelog = generateChangelog(contributions); + + console.log(changelog); +}).catch(function(err) { + console.error(err); +}) + +function generateChangelog(contributions) { + var header = '#### Community Contributions'; + var footer = 'Thank you to all who took the time to contribute!'; + + return header + EOL + EOL + contributions + EOL + EOL + footer; +} diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..39a94d3 --- /dev/null +++ b/changelog.md @@ -0,0 +1,19 @@ +### 0.0.6 + +This release adds an improvement for ssh-tunneling. see [#15](https://github.com/levelbossmike/ember-deploy-redis/pull/15) for details. + +#### Community Contributions + +- [#16](https://github.com/levelbossmike/ember-deploy-redis/pull/16) Updated docs to clarify tunnel-ssh options [@tmayr](https://github.com/tmayr) + +### 0.0.5 + +This release brings the long awaited SSH-tunneling feature. + +#### Community Contributions + +- [#9](https://github.com/levelbossmike/ember-deploy-redis/pull/9) Add support for SSH tunneling [@tim-evans](https://github.com/tim-evans) +- [#10](https://github.com/levelbossmike/ember-deploy-redis/pull/10) Allow camelCase auth_pass in adapter config [@jayphelps](https://github.com/jayphelps) +- [#11](https://github.com/levelbossmike/ember-deploy-redis/pull/11) Fix a typo [@raw1z](https://github.com/raw1z) + +Thank you to all who took the time to contribute! diff --git a/package.json b/package.json index f953a84..9597410 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ember-deploy-redis", - "version": "0.0.5", + "version": "0.0.6", "description": "ember-cli-deploy index-adapter for redis", "directories": { "doc": "doc", @@ -22,6 +22,7 @@ "chai": "^2.3.0", "chai-as-promised": "^5.0.0", "ember-cli": "0.2.5", + "github": "^0.2.4", "mocha": "^2.2.5" }, "keywords": [