Skip to content

Commit

Permalink
feat: add option to configure provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
diosif-cr committed Mar 21, 2024
1 parent 6afafb1 commit 914b361
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/nx-container/src/executors/build/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface Inputs {
noCacheFilters: string[];
outputs: string[];
platforms: string[];
provenance: string;
pull: boolean;
push: boolean;
secretFiles: string[];
Expand Down Expand Up @@ -85,6 +86,7 @@ export async function getInputs(
noCacheFilters: await getInputList('no-cache-filters', prefix, options['no-cache-filters']),
outputs: await getInputList('outputs', prefix, options.outputs, true),
platforms: await getInputList('platforms', prefix, options.platforms),
provenance: core.getInput('provenance'),
pull: core.getBooleanInput('pull', { fallback: `${options.pull || false}` }),
push: core.getBooleanInput('push', { fallback: `${options.push || false}` }),
secretFiles: await getInputList('secret-files', prefix, options['secret-files'], true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export class Docker extends EngineAdapter {
if (inputs.platforms.length > 0) {
args.push('--platform', inputs.platforms.join(','));
}
if (inputs.provenance) {
args.push('--provenance', inputs.provenance);
}
await asyncForEach(inputs.secrets, async (secret) => {
try {
args.push('--secret', await buildx.getSecretString(secret));
Expand Down
4 changes: 4 additions & 0 deletions packages/nx-container/src/executors/build/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export interface DockerBuildSchema {
* List of target platforms for build
*/
platforms?: string[];
/**
* Change or disable provenance attestations for the build result
*/
provenance?: string;
/**
* Always attempt to pull a newer version of the image (default false)
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/nx-container/src/executors/build/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
},
"description": "List of target platforms for build"
},
"provenance": {
"type": "string",
"description": "Change or disable provenance attestations for the build result"
},
"pull": {
"type": "boolean",
"description": "Always attempt to pull a newer version of the image (default false)",
Expand Down

0 comments on commit 914b361

Please sign in to comment.