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

Commit

Permalink
Merge pull request #54 from brigadecore/upgrade-vulnerable-deps
Browse files Browse the repository at this point in the history
upgrade modules with known vulnerabilities
  • Loading branch information
krancour committed Nov 29, 2021
2 parents 44f8f87 + e1d9227 commit a44f928
Show file tree
Hide file tree
Showing 3 changed files with 455 additions and 420 deletions.
35 changes: 31 additions & 4 deletions brigade.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { events, Job } = require("@brigadecore/brigadier")
const { Check } = require("@brigadecore/brigade-utils");

const projectName = "brigadier"
const nodeImage = "node:12.3.1-stretch"
const nodeImage = "node:12.22.7-bullseye"
const releaseTagRegex = /^refs\/tags\/v([0-9]+(?:\.[0-9]+)*(?:\-.+)?)$/;

function build() {
Expand All @@ -12,16 +12,43 @@ function build() {
"cd /src",
"yarn install",
"yarn compile",
"yarn test",
"yarn test"
];

return build;
}

function audit() {
var build = new Job(`${projectName}-audit`, nodeImage);

build.tasks = [
"cd /src",
"yarn install",
"yarn compile",
"yarn audit"
];

return build;
}

function runSuite(e, p) {
var check = new Check(e, p, build());
check.run();
// Important: To prevent Promise.all() from failing fast, we catch and
// return all errors. This ensures Promise.all() always resolves. We then
// iterate over all resolved values looking for errors. If we find one, we
// throw it so the whole build will fail.
//
// Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all#Promise.all_fail-fast_behaviour
//
// Note: as provided language string is used in job naming, it must consist
// of lowercase letters and hyphens only (per Brigade/K8s restrictions)
return Promise.all([
new Check(e, p, build()).run().catch((err) => { return err }),
new Check(e, p, audit()).run().catch((err) => { return err })
]).then((values) => {
values.forEach((value) => {
if (value instanceof Error) throw value;
});
});
}

function publish(project, version) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"devDependencies": {
"@types/chai": "^4.0.1",
"@types/mocha": "^2.2.41",
"@types/node": "^10.3.0",
"@types/node": "^12.20.37",
"chai": "^4.1.0",
"mocha": "^6.2.3",
"mocha": "^9.1.3",
"prettier": "^1.9.1",
"rimraf": "^2.6.2",
"ts-node": "^7.0.0",
"typedoc": "^0.15.0",
"typescript": "^3.2.2"
"typedoc": "^0.17.8",
"typescript": "^3.8.3"
},
"dependencies": {
"@kubernetes/client-node": "^0.10.1",
Expand Down
Loading

0 comments on commit a44f928

Please sign in to comment.