Browse Source

Finalize fixing admin scripts with kludge

pull/7101/head
jlukic 2 years ago
parent
commit
de2d7fceaf
5 changed files with 9625 additions and 308 deletions
  1. 9876
      package-lock.json
  2. 2
      package.json
  3. 21
      tasks/admin/components/update.js
  4. 32
      tasks/admin/distributions/update.js
  5. 2
      tasks/admin/release.js

9876
package-lock.json
File diff suppressed because it is too large
View File

2
package.json

@ -81,7 +81,7 @@
"yamljs": "^0.3.0"
},
"devDependencies": {
"@octokit/rest": "^17.9.2",
"@octokit/rest": "^19.0.4",
"gulp-concat-filenames": "*",
"gulp-debug": "^4.0.0",
"gulp-git": "^2.10.1",

21
tasks/admin/components/update.js

@ -12,7 +12,7 @@
*/
var
let
gulp = require('gulp'),
// node dependencies
@ -39,7 +39,7 @@ var
module.exports = function(callback) {
var
let
index = -1,
total = release.components.length,
timer,
@ -61,7 +61,7 @@ module.exports = function(callback) {
return;
}
var
let
component = release.components[index],
outputDirectory = path.resolve(path.join(release.outputRoot, component)),
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
@ -151,13 +151,20 @@ module.exports = function(callback) {
}
// create release on GitHub.com
function createRelease(version) {
async function createRelease(version) {
if(version) {
releaseOptions.target_commitish = version;
}
github.repos.createRelease(releaseOptions, function() {
nextRepo();
});
console.info('-----------------------------');
console.info(releaseOptions);
console.info('-----------------------------');
try {
await github.repos.createRelease(releaseOptions)
}
catch(e) {
console.error(`Release creation failed. Most likely already released "${releaseOptions.tag_name}"`);
};
nextRepo();
}
// Steps to next repository

32
tasks/admin/distributions/update.js

@ -12,7 +12,7 @@
*/
var
let
gulp = require('gulp'),
// node dependencies
@ -39,7 +39,7 @@ var
module.exports = function(callback) {
var
let
index = -1,
total = release.distributions.length,
timer,
@ -61,7 +61,7 @@ module.exports = function(callback) {
return;
}
var
let
distribution = release.distributions[index],
outputDirectory = path.resolve(path.join(release.outputRoot, distribution.toLowerCase() )),
repoName = release.distRepoRoot + distribution,
@ -141,18 +141,29 @@ module.exports = function(callback) {
function getSHA() {
git.exec(versionOptions, function(error, version) {
version = version.trim();
createRelease(version);
try {
createRelease(version);
} catch(e) {
console.error('Failed to create release, most likely this release already exists');
}
});
}
// create release on GitHub.com
function createRelease(version) {
async function createRelease(version) {
if(version) {
releaseOptions.target_commitish = version;
}
github.repos.createRelease(releaseOptions, function() {
nextRepo();
});
console.info('-----------------------------');
console.info(releaseOptions);
console.info('-----------------------------');
try {
await github.repos.createRelease(releaseOptions)
}
catch(e) {
console.error(`Release creation failed. Most likely already released "${releaseOptions.tag_name}"`);
};
nextRepo();
}
// Steps to next repository
@ -160,7 +171,10 @@ module.exports = function(callback) {
console.log('Sleeping for 1 second...');
// avoid rate throttling
global.clearTimeout(timer);
timer = global.setTimeout(stepRepo, 100);
timer = global.setTimeout(function() {
console.log('Sleeping complete');
stepRepo();
}, 100);
}

2
tasks/admin/release.js

@ -29,7 +29,7 @@ let
/* Release All */
release = series(
//build, // build Semantic
build, // build Semantic
initDistributions, // sync with current github version
createDistributions, // update each repo with changes from master repo
initComponents, // sync with current github version

Loading…
Cancel
Save