JSON structure fixes

This commit is contained in:
Jyotsna 2020-11-23 14:35:04 +05:30
parent 52883f3264
commit 34bbe17ae7
4 changed files with 14 additions and 8 deletions

View File

@ -38,9 +38,9 @@ function getWorkflowAnnotationsJson(lastSuccessRunSha, workflowFilePath, filePat
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
+ `'branch': '${process.env.GITHUB_REF}',`
+ `'deployTimestamp': '${Date.now()}',`
+ `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},`
+ `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},`
+ `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},`
+ `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',`
+ `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',`
+ `'helmChartPaths': '${filePathConfigs.helmChartPaths}',`
+ `'provider': 'GitHub'`
+ `}`;
}

View File

@ -149,7 +149,7 @@ function getFilePathsConfigs() {
let inputManifestFiles = inputParams.manifests || [];
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
filePathsConfig[HELM_CHART_KEY] = helmChartPaths;
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
//Fetch labels from each image
let imageToBuildConfigMap = [];
let imageNames = core.getInput('images').split('\n');
@ -190,6 +190,9 @@ function getFilePathsConfigs() {
if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
}
else {
imageToBuildConfigMap[image] = 'Not available';
}
}
}
filePathsConfig[DOCKERFILE_PATH_KEY] = imageToBuildConfigMap;

View File

@ -38,9 +38,9 @@ export function getWorkflowAnnotationsJson(lastSuccessRunSha: string, workflowFi
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
+ `'branch': '${process.env.GITHUB_REF}',`
+ `'deployTimestamp': '${Date.now()}',`
+ `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},`
+ `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},`
+ `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},`
+ `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',`
+ `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',`
+ `'helmChartPaths': '${filePathConfigs.helmChartPaths}',`
+ `'provider': 'GitHub'`
+ `}`;
}

View File

@ -141,7 +141,7 @@ export async function getFilePathsConfigs(): Promise<any> {
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
filePathsConfig[HELM_CHART_KEY] = helmChartPaths;
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
//Fetch labels from each image
let imageToBuildConfigMap: any = [];
@ -190,6 +190,9 @@ export async function getFilePathsConfigs(): Promise<any> {
if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
}
else{
imageToBuildConfigMap[image] = 'Not available';
}
}
}