diff --git a/tasks/config/packages.js b/tasks/config/packages.js index 4c9eae7118e25..3656bd5e638f1 100644 --- a/tasks/config/packages.js +++ b/tasks/config/packages.js @@ -1,7 +1,8 @@ export default (grunt) => { const VERSION = grunt.config.get('build.version'); + const SHORT_SHA = grunt.config.get('build.sha').substr(0, 7); - const FOLDER_STAGING = `kibana/staging/${VERSION.match(/\d\.\d\.\d/)[0]}-XXXXXXX/repos/${VERSION.match(/\d\./)[0]}x`; + const FOLDER_STAGING = `kibana/staging/${VERSION}-${SHORT_SHA}/repos/${VERSION.match(/\d\./)[0]}x`; const FOLDER_PRODUCTION = `kibana/${VERSION.match(/\d\./)[0]}x`; const FOLDERNAME_DEB = 'debian'; @@ -30,8 +31,8 @@ export default (grunt) => { }, production: { bucket: 'packages.elasticsearch.org', - debPrefix: PREFIX_STAGING_DEB, - rpmPrefix: PREFIX_STAGING_RPM + debPrefix: PREFIX_PRODUCTION_DEB, + rpmPrefix: PREFIX_PRODUCTION_RPM } }, user: 'kibana', diff --git a/tasks/release_packages.js b/tasks/release_packages.js index 7ed33a0956bbe..e55f8862e17e1 100644 --- a/tasks/release_packages.js +++ b/tasks/release_packages.js @@ -1,6 +1,4 @@ import exec from './utils/exec'; -import SimpleGit from 'simple-git'; -import { promisify } from 'bluebird'; import readline from 'readline'; export default (grunt) => { @@ -76,38 +74,31 @@ export default (grunt) => { grunt.registerTask('_publishPackages:upload', function (environment) { const aws = grunt.file.readJSON('.aws-config.json'); const signature = grunt.file.readJSON('.signing-config.json'); - const done = this.async(); - const simpleGit = new SimpleGit(); - const revparse = promisify(simpleGit.revparse, simpleGit); - return revparse(['--short', 'HEAD']) - .then(hash => { - const trimmedHash = hash.trim(); - platforms.forEach((platform) => { - if (platform.debPath) { - debS3({ - filePath: platform.debPath, - bucket: publishConfig[environment].bucket, - prefix: publishConfig[environment].debPrefix.replace('XXXXXXX', trimmedHash), - signatureKeyId: signature.id, - arch: platform.debArch, - awsKey: aws.key, - awsSecret: aws.secret - }); - } + platforms.forEach((platform) => { + if (platform.debPath) { + debS3({ + filePath: platform.debPath, + bucket: publishConfig[environment].bucket, + prefix: publishConfig[environment].debPrefix, + signatureKeyId: signature.id, + arch: platform.debArch, + awsKey: aws.key, + awsSecret: aws.secret + }); + } - if (platform.rpmPath) { - rpmS3({ - filePath: platform.rpmPath, - bucket: publishConfig[environment].bucket, - prefix: publishConfig[environment].rpmPrefix.replace('XXXXXXX', trimmedHash), - signingKeyName: signature.name, - awsKey: aws.key, - awsSecret: aws.secret - }); - } - }); - done(); + if (platform.rpmPath) { + rpmS3({ + filePath: platform.rpmPath, + bucket: publishConfig[environment].bucket, + prefix: publishConfig[environment].rpmPrefix, + signingKeyName: signature.name, + awsKey: aws.key, + awsSecret: aws.secret + }); + } }); + }); };