File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 3939 "type" : " boolean" ,
4040 "default" : true ,
4141 "description" : " Scan the image for high severity vulnerabilities"
42+ },
43+ "env" : {
44+ "type" : " object" ,
45+ "description" : " Environment variables to pass as build arguments to Docker" ,
46+ "additionalProperties" : {
47+ "type" : " string"
48+ }
4249 }
4350 },
4451 "required" : [" directory" , " ecr_repository" ]
Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ jobs:
112112 image_tag_branch_name: imageTagBranchName,
113113 ecr_respositories: flavor.components.map(component => component.ecr_repository),
114114 components: flavor.components.map(component => {
115+ // Format env variables as build-args string
116+ const envBuildArgs = component.env ?
117+ Object.entries(component.env).map(([key, value]) => `${key}=${value}`).join('\n') : '';
118+
115119 return {
116120 ...component,
117121 // Add metadata to the component object (will be used as matrix input),
@@ -121,6 +125,7 @@ jobs:
121125 build_time: buildTime,
122126 image_tag: imageTag,
123127 image_tag_branch_name: imageTagBranchName,
128+ env_build_args: envBuildArgs,
124129 };
125130 }),
126131 };
@@ -221,6 +226,7 @@ jobs:
221226 DATAVISYN_PYTHON_BASE_IMAGE=${{ env.DATAVISYN_PYTHON_BASE_IMAGE }}
222227 NODE_BASE_IMAGE=${{ env.NODE_BASE_IMAGE }}
223228 DATAVISYN_NGINX_BASE_IMAGE=${{ env.DATAVISYN_NGINX_BASE_IMAGE }}
229+ ${{ matrix.component.env_build_args }}
224230 secrets :
225231 # Mount the token as secret mount: https://docs.docker.com/build/ci/github-actions/secrets/#secret-mounts
226232 " github_token=${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}"
You can’t perform that action at this time.
0 commit comments