From 1f0deb01a11d0288ca0a0634f0c0503174f61475 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 18 Dec 2024 17:01:11 -0800 Subject: [PATCH] fix: allow more preset --- src/cli.js | 2 +- src/docker.js | 3 +-- src/docker.test.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cli.js b/src/cli.js index 2b7feeb..3346541 100755 --- a/src/cli.js +++ b/src/cli.js @@ -188,7 +188,7 @@ export default function getCLI(context) { program.command('docker') .description('Generates/run docker build commands use in CI') - .option('-t, --preset ', 'Build preset', /^(lean|dev|dockerize|websocket|py310|ci|py311)$/i, 'lean') + .option('-t, --preset ', 'Build preset', /^(lean|dev|dockerize|python-base|superset-node|superset-node-ci|websocket|py310|ci|py311)$/i, 'lean') .option('-c, --context ', 'Build context', /^(push|pull_request|release)$/i, 'local') .option('-r, --context-ref ', 'Reference to the PR, release, or branch') .option('-p, --platform ', 'Platforms (multiple values allowed)') diff --git a/src/docker.js b/src/docker.js index b873eb6..d81bca3 100644 --- a/src/docker.js +++ b/src/docker.js @@ -69,7 +69,6 @@ export function getDockerTags({ tags.add(makeDockerTag([`GHA-${process.env.GITHUB_RUN_ID}`])); } - return [...tags]; } @@ -120,7 +119,7 @@ export async function getDockerCommand({ }).map((tag) => `-t ${tag}`).join(' \\\n '); const isAuthenticated = !!(process.env.DOCKERHUB_TOKEN); - let dockerArgs = ""; + let dockerArgs = ''; dockerArgs += push || isAuthenticated ? ' --push ' : ''; dockerArgs += load ? ' --load ' : ''; const targetArgument = buildTarget ? `--target ${buildTarget}` : ''; diff --git a/src/docker.test.js b/src/docker.test.js index 13e9f28..5637ee3 100644 --- a/src/docker.test.js +++ b/src/docker.test.js @@ -12,7 +12,7 @@ jest.mock('./github.js', () => jest.fn().mockImplementation(() => NEW_REL)); beforeEach(() => { process.env.TEST_ENV = 'true'; process.env.DOCKERHUB_TOKEN = 'dummy'; - process.env.GITHUB_RUN_ID= '123'; + process.env.GITHUB_RUN_ID = '123'; }); afterEach(() => {