Merge pull request #7571 from jbudz/publish-staging
[build] Include full version in staging package prefix, set productio…
This commit is contained in:
commit
717589e1b9
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue