Skip to content

Commit

Permalink
Fix TypeError in publish
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jun 5, 2024
1 parent a534766 commit 6b95ef4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
11 changes: 7 additions & 4 deletions packages/kira-release/lib/publish.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = async (pluginConfig, { nextRelease: { version }, logger }) => {
const execa = await import('execa')
const execaModule = await import('execa')
const execa = execaModule.execa

const registry = process.env.CI_REGISTRY
logger.log(
Expand All @@ -11,9 +12,11 @@ module.exports = async (pluginConfig, { nextRelease: { version }, logger }) => {
)

// Push both new version and latest
execa('docker', ['push', `${registry}/${pluginConfig.imageName}:latest`], {
stdio: 'inherit',
})
execa(
'docker',
['push', `${registry}/${pluginConfig.imageName}:latest`],
{ stdio: 'inherit' },
)
execa(
'docker',
[
Expand Down
29 changes: 12 additions & 17 deletions packages/kira-release/lib/verify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = async (pluginConfig, { logger }) => {
const execa = await import('execa')
const execaModule = await import('execa')
const execa = execaModule.execa

const requiredEnvVars = [
'CI_JOB_TOKEN',
Expand All @@ -18,20 +19,14 @@ module.exports = async (pluginConfig, { logger }) => {
throw new Error('image name is not set in the config')
}

try {
await execa.execa(
'docker',
[
'login',
`-u=${process.env.CI_REGISTRY_USER}`,
`-p=${process.env.CI_JOB_TOKEN}`,
process.env.CI_REGISTRY,
],
{
stdio: 'inherit',
},
)
} catch (err) {
throw new Error('GitLab registry login failed', { cause: err })
}
await execa(
'docker',
[
'login',
`-u=${process.env.CI_REGISTRY_USER}`,
`-p=${process.env.CI_JOB_TOKEN}`,
process.env.CI_REGISTRY,
],
{ stdio: 'inherit' },
)
}

0 comments on commit 6b95ef4

Please sign in to comment.