Skip to content

Commit

Permalink
fix(verify): fix logic around the conditional prepare step
Browse files Browse the repository at this point in the history
corrects a logic bug that allows prepare steps to build when not in dry
run mode
  • Loading branch information
esatterwhite committed Mar 25, 2024
1 parent 202308c commit e093ffd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function buildConfig(build_id, config, context) {
, publish
, tags: array.toArray(tags)
, verifycmd
, dry_run
, dry_run: !!typeCast(dry_run || context.dryRun)
, args: {
SRC_DIRECTORY: path.basename(context.cwd)
, TARGET_PATH: target
Expand Down
3 changes: 2 additions & 1 deletion lib/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ async function verify(opts, context) {
await doLogin({...opts, USERNAME, PASSWORD}, context)
}

if (!opts.verifycmd && !opts.dry_run) return true
if (!opts.verifycmd) return true
if (!opts.dry_run) return true

const img = await prepare(opts, context)
const output = await img.run(opts.verifycmd)
Expand Down
3 changes: 1 addition & 2 deletions test/integration/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ test('steps::prepare', async (t) => {
, logger: logger
}


const config = await buildConfig(build_id, {
dockerRegistry: DOCKER_REGISTRY_HOST
, dockerProject: 'docker-prepare'
Expand All @@ -57,7 +56,7 @@ test('steps::prepare', async (t) => {
}
, dockerFile: 'docker/Dockerfile.prepare'
, dockerContext: 'docker'
}, context)
}, {...context, dryRun: true})

tt.match(
await verify(config, context)
Expand Down

0 comments on commit e093ffd

Please sign in to comment.