mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-12 17:42:20 +08:00
JSON structure fixes
This commit is contained in:
parent
52883f3264
commit
34bbe17ae7
@ -38,9 +38,9 @@ function getWorkflowAnnotationsJson(lastSuccessRunSha, workflowFilePath, filePat
|
|||||||
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
|
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
|
||||||
+ `'branch': '${process.env.GITHUB_REF}',`
|
+ `'branch': '${process.env.GITHUB_REF}',`
|
||||||
+ `'deployTimestamp': '${Date.now()}',`
|
+ `'deployTimestamp': '${Date.now()}',`
|
||||||
+ `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},`
|
+ `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',`
|
||||||
+ `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},`
|
+ `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',`
|
||||||
+ `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},`
|
+ `'helmChartPaths': '${filePathConfigs.helmChartPaths}',`
|
||||||
+ `'provider': 'GitHub'`
|
+ `'provider': 'GitHub'`
|
||||||
+ `}`;
|
+ `}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,7 +149,7 @@ function getFilePathsConfigs() {
|
|||||||
let inputManifestFiles = inputParams.manifests || [];
|
let inputManifestFiles = inputParams.manifests || [];
|
||||||
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
|
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
|
||||||
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
||||||
filePathsConfig[HELM_CHART_KEY] = helmChartPaths;
|
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
||||||
//Fetch labels from each image
|
//Fetch labels from each image
|
||||||
let imageToBuildConfigMap = [];
|
let imageToBuildConfigMap = [];
|
||||||
let imageNames = core.getInput('images').split('\n');
|
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])) {
|
if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) {
|
||||||
imageToBuildConfigMap[image] = 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;
|
filePathsConfig[DOCKERFILE_PATH_KEY] = imageToBuildConfigMap;
|
||||||
|
|||||||
@ -38,9 +38,9 @@ export function getWorkflowAnnotationsJson(lastSuccessRunSha: string, workflowFi
|
|||||||
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
|
+ `'lastSuccessRunCommit': '${lastSuccessRunSha}',`
|
||||||
+ `'branch': '${process.env.GITHUB_REF}',`
|
+ `'branch': '${process.env.GITHUB_REF}',`
|
||||||
+ `'deployTimestamp': '${Date.now()}',`
|
+ `'deployTimestamp': '${Date.now()}',`
|
||||||
+ `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},`
|
+ `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',`
|
||||||
+ `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},`
|
+ `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',`
|
||||||
+ `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},`
|
+ `'helmChartPaths': '${filePathConfigs.helmChartPaths}',`
|
||||||
+ `'provider': 'GitHub'`
|
+ `'provider': 'GitHub'`
|
||||||
+ `}`;
|
+ `}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,7 +141,7 @@ export async function getFilePathsConfigs(): Promise<any> {
|
|||||||
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
|
filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles;
|
||||||
|
|
||||||
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
let helmChartPaths = process.env.HELM_CHART_PATHS || '';
|
||||||
filePathsConfig[HELM_CHART_KEY] = helmChartPaths;
|
filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n');
|
||||||
|
|
||||||
//Fetch labels from each image
|
//Fetch labels from each image
|
||||||
let imageToBuildConfigMap: any = [];
|
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])){
|
if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){
|
||||||
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY];
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
imageToBuildConfigMap[image] = 'Not available';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user