Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Assign slug a commit ID for Git based projects #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions commands/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ function release(context) {
}
}

function readCommit() {
return new Promise(function (fulfill, reject) {
child.execFile('git', ['rev-parse', 'HEAD'], function (error, stdout) {
if (error) { return fulfill(); }
return fulfill(stdout.trim());
});
});
}

function readRemoteAddons() {
return app.addons().list();
}
Expand Down Expand Up @@ -135,15 +144,19 @@ function release(context) {
}

function createRemoteSlug(slug) {
var lang = `heroku-docker (${ slug.name || 'unknown'})`;
cli.log(`creating remote slug...`);
cli.log(`language-pack: ${ lang }`);
cli.log('remote process types:', modifiedProc);
var slugInfo = app.slugs().create({
process_types: modifiedProc,
buildpack_provided_description: lang
return readCommit().then(commit => {
var lang = `heroku-docker (${ slug.name || 'unknown'})`;
cli.log(`creating remote slug...`);
cli.log(`language-pack: ${ lang }`);
cli.log('remote process types:', modifiedProc);
cli.log('commit id:', commit);
var slugInfo = app.slugs().create({
process_types: modifiedProc,
buildpack_provided_description: lang,
commit
});
return Promise.all([slug.path, slugInfo])
});
return Promise.all([slug.path, slugInfo])
}

function uploadSlug(slug) {
Expand Down