157 lines
4.2 KiB
Jsonnet
157 lines
4.2 KiB
Jsonnet
local pipeline_helper = import 'pipeline_helper.jsonnet';
|
|
local pipeline_manifest = import 'pipeline_manifest.json';
|
|
local pipelines = pipeline_manifest.pipelines;
|
|
local name = pipeline_manifest.name;
|
|
local infraVertical = pipeline_manifest.infraVertical;
|
|
|
|
local githubOrgMap = {
|
|
lending:: {
|
|
default:: 'git@github.com:navi-medici/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
'data-platform-prod':: 'git@github.com:navi-data/',
|
|
'data-platform-nonprod':: 'git@github.com:navi-data/',
|
|
},
|
|
insurance:: {
|
|
default:: 'git@github.com:navi-gi/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
infra:: {
|
|
default: 'git@github.com:navi-infra/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
amc:: {
|
|
default: 'git@github.com:navi-amc/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
sa:: {
|
|
default: 'git@github.com:navi-sa/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
colending:: {
|
|
default: 'git@github.com:navi-co-lending/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
'navi-pay':: {
|
|
default: 'git@github.com:navi-pay/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
'navi-saas':: {
|
|
default: 'git@github.com:navi-saas/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
'navi-ppl':: {
|
|
default: 'git@github.com:navi-ppl/',
|
|
prod:: self.default,
|
|
qa:: self.default,
|
|
dev:: self.default,
|
|
uat:: self.default,
|
|
perf:: self.default,
|
|
test:: self.default,
|
|
build:: self.default,
|
|
},
|
|
};
|
|
|
|
{
|
|
getMaterial(name, env):: {
|
|
test:: {
|
|
plugin_configuration: {
|
|
id: 'github.pr',
|
|
version: '1.4.0-RC2',
|
|
},
|
|
options: {
|
|
url: githubOrgMap[infraVertical][env] + name + '.git',
|
|
branch: 'master',
|
|
},
|
|
destination: 'test',
|
|
},
|
|
build:: {
|
|
git: {
|
|
git: githubOrgMap[infraVertical][env] + name + '.git',
|
|
shallow_clone: true,
|
|
branch: 'master',
|
|
},
|
|
},
|
|
'rds-deploy':: {
|
|
mygit: {
|
|
git: githubOrgMap[infraVertical][env] + name + '.git',
|
|
shallow_clone: true,
|
|
branch: 'master',
|
|
},
|
|
},
|
|
's3-deploy':: self['rds-deploy'],
|
|
'iam-deploy':: self['rds-deploy'],
|
|
'redis-deploy':: self['rds-deploy'],
|
|
'docdb-deploy':: self['rds-deploy'],
|
|
'migrate-deploy':: {
|
|
git: {
|
|
git: githubOrgMap[infraVertical][env] + name + '.git',
|
|
shallow_clone: true,
|
|
branch: 'master',
|
|
},
|
|
},
|
|
},
|
|
getUpstreamMaterial(name, pipeline)::
|
|
(if pipeline.type == 'migrate-deploy' then {
|
|
code: {
|
|
pipeline: pipeline_helper.getUpstreamPipelineName(pipeline),
|
|
stage: pipeline_helper.getUpstreamPipelineStage(pipeline),
|
|
},
|
|
} else {}),
|
|
material(name, pipeline):: $.getMaterial(name, pipeline.env)[pipeline.type] + $.getUpstreamMaterial(name, pipeline),
|
|
pipelineName(name, pipeline):: $.getPipelineName(name, pipeline.type, pipeline.env),
|
|
getPipelineName(name, type, env)::
|
|
if type == 'test' || type == 'build' then
|
|
(name + '-' + type)
|
|
else if type == 'rds-deploy' || type == 's3-deploy' || type == 'redis-deploy' || type == 'docdb-deploy' || type == 'iam-deploy' then
|
|
(name + '-' + env + '-all-resource-deploy')
|
|
else (name + '-' + env + '-' + type),
|
|
}
|