-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking pull request to merge release-0.1.0 to main (#9)
- Loading branch information
1 parent
d056d39
commit fedcbb8
Showing
281 changed files
with
14,131 additions
and
1,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
__pycache__/ | ||
.coverage | ||
.DS_Store | ||
.env | ||
.idea/ | ||
.minio.sys/ | ||
.pyc | ||
.sql.gz | ||
.vscode/ | ||
*.py[cod] | ||
build/ | ||
db.sqlite3 | ||
django/.coverage | ||
django/staticfiles/ | ||
django/venv/ | ||
node_modules/ | ||
public/ | ||
package-lock.json | ||
public/static/ | ||
react/node_modules/ | ||
TEST-*xml | ||
venv/ | ||
|
||
db.sqlite3 | ||
.coverage | ||
frontend/coverage/ | ||
backend/minio/ | ||
.sql.gz | ||
coverage/ | ||
minio/minio_files/cthub/ | ||
decoder.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const task = require('./lib/build-metabase.js') | ||
const settings = require('./lib/config.js') | ||
|
||
task(Object.assign(settings, { phase: 'build'})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const task = require('./lib/build-patroni.js') | ||
const settings = require('./lib/config.js') | ||
|
||
task(Object.assign(settings, { phase: 'build'})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const settings = require('./lib/config.js') | ||
const task = require('./lib/clean-tools.js') | ||
|
||
task(Object.assign(settings, { phase: settings.options.env})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const settings = require('./lib/config.js') | ||
const task = require('./lib/deploy-knp.js') | ||
|
||
task(Object.assign(settings, { phase: settings.options.env})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const settings = require('./lib/config.js') | ||
const task = require('./lib/deploy-metabase.js') | ||
|
||
task(Object.assign(settings, { phase: settings.options.env})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
const settings = require('./lib/config.js') | ||
const task = require('./lib/deploy-patroni.js') | ||
|
||
task(Object.assign(settings, { phase: settings.options.env})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
const { OpenShiftClientX } = require("@bcgov/pipeline-cli"); | ||
const path = require("path"); | ||
|
||
module.exports = settings => { | ||
const phases = settings.phases; | ||
const options = settings.options; | ||
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); | ||
const phase = "build"; | ||
let objects = []; | ||
const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, "../../openshift")); | ||
|
||
// The building of your cool app goes here ▼▼▼ | ||
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/metabase/metabase-bc.yaml`, {})); | ||
|
||
oc.applyRecommendedLabels( | ||
objects, | ||
phases[phase].name, | ||
phase, | ||
phases[phase].changeId, | ||
phases[phase].instance, | ||
); | ||
oc.applyAndBuild(objects); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
const { OpenShiftClientX } = require("@bcgov/pipeline-cli"); | ||
const path = require("path"); | ||
|
||
module.exports = settings => { | ||
const phases = settings.phases; | ||
const options = settings.options; | ||
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); | ||
const phase = "build"; | ||
let objects = []; | ||
const templatesLocalBaseUrl = oc.toFileUrl(path.resolve(__dirname, "../../openshift")); | ||
|
||
// The building of your cool app goes here ▼▼▼ | ||
objects = objects.concat(oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/templates/patroni-2.1.1/templates/build.yaml`, {})); | ||
|
||
oc.applyRecommendedLabels( | ||
objects, | ||
phases[phase].name, | ||
phase, | ||
phases[phase].changeId, | ||
phases[phase].instance, | ||
); | ||
oc.applyAndBuild(objects); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
"use strict"; | ||
const { OpenShiftClientX } = require("@bcgov/pipeline-cli"); | ||
|
||
// The clean tasks should be based on the following five labels added by BCDK pipeline | ||
// namespace: '30b186-tools', | ||
// transient: true, | ||
// name: 'cthub', | ||
// phase: 'build', | ||
// changeId: '46', | ||
// suffix: '-build-46', | ||
// instance: 'cthub-build-46', | ||
// version: '1.0.0-46', | ||
// tag: 'build-1.0.0-46', | ||
// ocpName: 'apps.silver.devops' | ||
|
||
const getTargetPhases = (env, phases) => { | ||
let target_phase = []; | ||
for (const phase in phases) { | ||
if (env.match(/^(all|transient)$/) && phases[phase].transient) { | ||
target_phase.push(phase); | ||
} else if (env === phase) { | ||
target_phase.push(phase); | ||
break; | ||
} | ||
} | ||
|
||
return target_phase; | ||
}; | ||
|
||
module.exports = settings => { | ||
const phases = settings.phases; | ||
const options = settings.options; | ||
const oc = new OpenShiftClientX(Object.assign({ namespace: phases.build.namespace }, options)); | ||
const target_phases = getTargetPhases(options.env, phases); | ||
|
||
target_phases.forEach(k => { | ||
if (phases.hasOwnProperty(k)) { | ||
|
||
const phase = phases[k]; | ||
oc.namespace(phase.namespace); | ||
|
||
let buildConfigs = oc.get("bc", { | ||
selector: `app=${phase.instance},env-id=${phase.changeId},!shared,github-repo=${oc.git.repository},github-owner=${oc.git.owner}`, | ||
namespace: phase.namespace, | ||
}); | ||
|
||
buildConfigs.forEach(bc => { | ||
if (bc.spec.output.to.kind == "ImageStreamTag") { | ||
oc.delete([`ImageStreamTag/${bc.spec.output.to.name}`], { | ||
"ignore-not-found": "true", | ||
wait: "true", | ||
namespace: phase.namespace, | ||
}); | ||
} | ||
oc.delete([`BuildConfig/${bc.metadata.name}`], { | ||
"ignore-not-found": "true", | ||
wait: "true", | ||
namespace: phase.namespace, | ||
}); | ||
}); | ||
|
||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.