forked from redhat-developer/s2i-dotnetcore
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from bcgov/2.0
2.0
- Loading branch information
Showing
26 changed files
with
264 additions
and
303 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,36 +1,56 @@ | ||
'use strict'; | ||
const {OpenShiftClientX} = require('@bcgov/pipeline-cli') | ||
const path = require('path'); | ||
"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' | ||
var objects = [] | ||
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"; | ||
var objects = []; | ||
|
||
const templatesLocalBaseUrl =oc.toFileUrl(path.resolve(__dirname, '../../openshift')) | ||
const templatesLocalBaseUrl = oc.toFileUrl( | ||
path.resolve(__dirname, "../../openshift") | ||
); | ||
|
||
objects.push(...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/build-master.yaml`, { | ||
'param':{ | ||
'NAME': phases[phase].name, | ||
'SUFFIX': phases[phase].suffix, | ||
'VERSION': phases[phase].tag, | ||
'SOURCE_REPOSITORY_URL': oc.git.http_url, | ||
'SOURCE_REPOSITORY_REF': oc.git.ref | ||
} | ||
})); | ||
objects.push( | ||
...oc.processDeploymentTemplate( | ||
`${templatesLocalBaseUrl}/build-master.yaml`, | ||
{ | ||
param: { | ||
NAME: phases[phase].name, | ||
SUFFIX: phases[phase].suffix, | ||
VERSION: phases[phase].tag, | ||
SOURCE_REPOSITORY_URL: oc.git.http_url, | ||
SOURCE_REPOSITORY_REF: oc.git.ref, | ||
}, | ||
} | ||
) | ||
); | ||
|
||
objects.push(...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/build-slave.yaml`, { | ||
'param':{ | ||
'NAME': phases[phase].name, | ||
'SUFFIX': phases[phase].suffix, | ||
'VERSION': phases[phase].tag, | ||
'SOURCE_IMAGE_STREAM_TAG': `${phases[phase].name}:${phases[phase].tag}`, | ||
'SLAVE_NAME':'main' | ||
} | ||
})); | ||
objects.push( | ||
...oc.processDeploymentTemplate( | ||
`${templatesLocalBaseUrl}/build-slave.yaml`, | ||
{ | ||
param: { | ||
NAME: phases[phase].name, | ||
SUFFIX: phases[phase].suffix, | ||
VERSION: phases[phase].tag, | ||
SOURCE_IMAGE_STREAM_TAG: `${phases[phase].name}:${phases[phase].tag}`, | ||
SLAVE_NAME: "main", | ||
}, | ||
} | ||
) | ||
); | ||
|
||
oc.applyRecommendedLabels(objects, phases[phase].name, phase, phases[phase].changeId, phases[phase].instance) | ||
oc.applyAndBuild(objects) | ||
} | ||
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
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
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,44 +1,68 @@ | ||
'use strict'; | ||
const {OpenShiftClientX} = require('@bcgov/pipeline-cli') | ||
const path = require('path'); | ||
"use strict"; | ||
const { OpenShiftClientX } = require("@bcgov/pipeline-cli"); | ||
const path = require("path"); | ||
|
||
module.exports = (settings)=>{ | ||
const phases = settings.phases | ||
const options = settings.options | ||
const phase=options.env | ||
const changeId = phases[phase].changeId | ||
const oc=new OpenShiftClientX(Object.assign({'namespace':phases[phase].namespace}, options)); | ||
var objects = [] | ||
module.exports = (settings) => { | ||
const phases = settings.phases; | ||
const options = settings.options; | ||
const phase = options.env; | ||
const changeId = phases[phase].changeId; | ||
const oc = new OpenShiftClientX( | ||
Object.assign({ namespace: phases[phase].namespace }, options) | ||
); | ||
var objects = []; | ||
|
||
const templatesLocalBaseUrl =oc.toFileUrl(path.resolve(__dirname, '../../openshift')) | ||
const templatesLocalBaseUrl = oc.toFileUrl( | ||
path.resolve(__dirname, "../../openshift") | ||
); | ||
|
||
objects.push(...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/deploy-master.yaml`, { | ||
'param':{ | ||
'NAME': phases[phase].name, | ||
'SUFFIX': phases[phase].suffix, | ||
'VERSION': phases[phase].tag, | ||
'ENV_NAME': phases[phase].phase, | ||
'ROUTE_HOST': `${phases[phase].name}${phases[phase].suffix}-${phases[phase].namespace}.pathfinder.gov.bc.ca` | ||
} | ||
})) | ||
objects.push( | ||
...oc.processDeploymentTemplate( | ||
`${templatesLocalBaseUrl}/deploy-master.yaml`, | ||
{ | ||
param: { | ||
NAME: phases[phase].name, | ||
SUFFIX: phases[phase].suffix, | ||
VERSION: phases[phase].tag, | ||
ENV_NAME: phases[phase].phase, | ||
ROUTE_HOST: `${phases[phase].name}${phases[phase].suffix}-${phases[phase].namespace}.apps.silver.devops.gov.bc.ca`, | ||
}, | ||
} | ||
) | ||
); | ||
|
||
objects.push(...oc.processDeploymentTemplate(`${templatesLocalBaseUrl}/deploy-slave.yaml`, { | ||
'param':{ | ||
'NAME': phases[phase].name, | ||
'SUFFIX': phases[phase].suffix, | ||
'VERSION': phases[phase].tag, | ||
'SLAVE_NAME': 'build', | ||
'SLAVE_LABELS': 'build deploy test ui-test', | ||
'SLAVE_EXECUTORS': '3', | ||
'CPU_REQUEST': '300m', | ||
'CPU_LIMIT': '500m', | ||
'MEMORY_REQUEST': '2Gi', | ||
'MEMORY_LIMIT': '2Gi' | ||
} | ||
})) | ||
objects.push( | ||
...oc.processDeploymentTemplate( | ||
`${templatesLocalBaseUrl}/deploy-slave.yaml`, | ||
{ | ||
param: { | ||
NAME: phases[phase].name, | ||
SUFFIX: phases[phase].suffix, | ||
VERSION: phases[phase].tag, | ||
SLAVE_NAME: "build", | ||
SLAVE_LABELS: "build deploy test ui-test", | ||
SLAVE_EXECUTORS: "3", | ||
CPU_REQUEST: "300m", | ||
CPU_LIMIT: "500m", | ||
MEMORY_REQUEST: "2Gi", | ||
MEMORY_LIMIT: "2Gi", | ||
}, | ||
} | ||
) | ||
); | ||
|
||
oc.applyRecommendedLabels(objects, phases[phase].name, phase, `${changeId}`, phases[phase].instance) | ||
oc.importImageStreams(objects, phases[phase].tag, phases.build.namespace, phases.build.tag) | ||
oc.applyAndDeploy(objects, phases[phase].instance) | ||
|
||
} | ||
oc.applyRecommendedLabels( | ||
objects, | ||
phases[phase].name, | ||
phase, | ||
`${changeId}`, | ||
phases[phase].instance | ||
); | ||
oc.importImageStreams( | ||
objects, | ||
phases[phase].tag, | ||
phases.build.namespace, | ||
phases.build.tag | ||
); | ||
oc.applyAndDeploy(objects, phases[phase].instance); | ||
}; |
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
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
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.