mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-13 01:52:20 +08:00
JSON structure fixes
This commit is contained in:
parent
34bbe17ae7
commit
ba95de9cac
@ -151,12 +151,13 @@ function getFilePathsConfigs() {
|
|||||||
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
||||||
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
||||||
//Fetch labels from each image
|
//Fetch labels from each image
|
||||||
let imageToBuildConfigMap = [];
|
|
||||||
let imageNames = core.getInput('images').split('\n');
|
let imageNames = core.getInput('images').split('\n');
|
||||||
|
let imageDockerfilePathList = [];
|
||||||
for (const image of imageNames) {
|
for (const image of imageNames) {
|
||||||
let args = [image];
|
let args = [image];
|
||||||
let resultObj;
|
let resultObj;
|
||||||
let containerRegistryName = image;
|
let containerRegistryName = image;
|
||||||
|
let imageDockerfilePathObj = {};
|
||||||
try {
|
try {
|
||||||
let usrname = process.env.CR_USERNAME || null;
|
let usrname = process.env.CR_USERNAME || null;
|
||||||
let pwd = process.env.CR_PASSWORD || null;
|
let pwd = process.env.CR_PASSWORD || null;
|
||||||
@ -188,14 +189,15 @@ function getFilePathsConfigs() {
|
|||||||
if (resultObj) {
|
if (resultObj) {
|
||||||
resultObj = resultObj[0];
|
resultObj = resultObj[0];
|
||||||
if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
|
if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
|
||||||
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
imageDockerfilePathObj[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
imageToBuildConfigMap[image] = 'Not available';
|
imageDockerfilePathObj[image] = 'Not available';
|
||||||
}
|
}
|
||||||
|
imageDockerfilePathList.push(imageDockerfilePathObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
filePathsConfig[DOCKERFILE_PATH_KEY] = imageToBuildConfigMap;
|
filePathsConfig[DOCKERFILE_PATH_KEY] = imageDockerfilePathList;
|
||||||
return Promise.resolve(filePathsConfig);
|
return Promise.resolve(filePathsConfig);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,13 +144,15 @@ export async function getFilePathsConfigs(): Promise<any> {
|
|||||||
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
||||||
|
|
||||||
//Fetch labels from each image
|
//Fetch labels from each image
|
||||||
let imageToBuildConfigMap: any = [];
|
|
||||||
let imageNames = core.getInput('images').split('\n');
|
let imageNames = core.getInput('images').split('\n');
|
||||||
|
let imageDockerfilePathList: any = [];
|
||||||
|
|
||||||
for(const image of imageNames){
|
for(const image of imageNames){
|
||||||
let args: string[] = [image];
|
let args: string[] = [image];
|
||||||
let resultObj: any;
|
let resultObj: any;
|
||||||
let containerRegistryName = image;
|
let containerRegistryName = image;
|
||||||
|
let imageDockerfilePathObj: any = {};
|
||||||
|
|
||||||
try{
|
try{
|
||||||
let usrname = process.env.CR_USERNAME || null;
|
let usrname = process.env.CR_USERNAME || null;
|
||||||
@ -188,15 +190,16 @@ export async function getFilePathsConfigs(): Promise<any> {
|
|||||||
if(resultObj){
|
if(resultObj){
|
||||||
resultObj = resultObj[0];
|
resultObj = resultObj[0];
|
||||||
if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
|
if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
|
||||||
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
imageDockerfilePathObj[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
imageToBuildConfigMap[image] = 'Not available';
|
imageDockerfilePathObj[image] = 'Not available';
|
||||||
}
|
}
|
||||||
|
imageDockerfilePathList.push(imageDockerfilePathObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filePathsConfig[DOCKERFILE_PATH_KEY] = imageToBuildConfigMap;
|
filePathsConfig[DOCKERFILE_PATH_KEY] = imageDockerfilePathList;
|
||||||
|
|
||||||
return Promise.resolve(filePathsConfig);
|
return Promise.resolve(filePathsConfig);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user