mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-21 16:38:41 -06:00
Generate supported channels yml files for all builds (#1914)
This commit is contained in:
parent
a0a37b0e55
commit
5e10ab3fdd
@ -1,7 +1,5 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const crypto = require('crypto');
|
||||
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const INSTALLERS_URL = 'https://static.symphony.com/sda/';
|
||||
@ -13,7 +11,17 @@ function updateYamlFile(yamlFilePath) {
|
||||
fs.writeFileSync(yamlFilePath, yaml.dump(doc, { lineWidth: -1 }));
|
||||
}
|
||||
|
||||
function generateChannelsFiles(srcFile) {
|
||||
// "latest" channel is already created so we need to generate stable, beta and daily
|
||||
const targetedAutoUpdateChannels = ['stable', 'beta', 'daily'];
|
||||
for (const channel of targetedAutoUpdateChannels) {
|
||||
const updatedFileName = srcFile.replace('latest', channel);
|
||||
fs.copyFileSync(srcFile, updatedFileName);
|
||||
}
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const yamlFilePath = process.argv[2];
|
||||
updateYamlFile(yamlFilePath);
|
||||
generateChannelsFiles(yamlFilePath);
|
||||
})();
|
||||
|
@ -16,7 +16,20 @@ function updateYamlFile(yamlFilePath, installerHash) {
|
||||
fs.writeFileSync(yamlFilePath, yaml.dump(doc, { lineWidth: -1 }));
|
||||
}
|
||||
|
||||
function getHashFile(
|
||||
function generateChannelsFiles(srcFile) {
|
||||
// "latest" channel is already created so we need to generate stable, beta and daily
|
||||
const targetedAutoUpdateChannels = ['stable', 'beta', 'iv', 'daily'];
|
||||
for (const channel of targetedAutoUpdateChannels) {
|
||||
const updatedFileName = srcFile.replace('latest', channel);
|
||||
fs.copyFileSync(
|
||||
yamlFilePath,
|
||||
updatedFileName,
|
||||
fs.constants.COPYFILE_FICLONE_FORCE,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function updateHash(
|
||||
file,
|
||||
yamlFilePath,
|
||||
algorithm = 'sha512',
|
||||
@ -50,5 +63,6 @@ function getHashFile(
|
||||
(async () => {
|
||||
const installerPath = process.argv[2];
|
||||
const yamlFilePath = process.argv[3];
|
||||
await getHashFile(installerPath, yamlFilePath);
|
||||
await updateHash(installerPath, yamlFilePath);
|
||||
generateChannelsFiles(yamlFilePath);
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user