Skip to content

Commit

Permalink
Fix image existence check in release script (#558)
Browse files Browse the repository at this point in the history
* Fix image existence check in release script

* remove automatic release script

* leftover
  • Loading branch information
Janpot authored Jun 15, 2022
1 parent 28e0f63 commit 1bc11c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 42 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.7'

services:
toolpad:
image: muicom/toolpad:${TAG:-alpha}
image: muicom/toolpad:${TAG:-latest}
environment:
- TOOLPAD_DATABASE_URL=postgresql://toolpad-app:secretpw@postgres:5432/postgres?connect_timeout=10
ports:
Expand Down
16 changes: 12 additions & 4 deletions scripts/releaseDocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ const LATEST_TAG = 'latest';

async function checkTagExists(image, tag) {
const { execa } = await import('execa');
const { exitCode } = await execa('docker', ['manifest', 'inspect', `${image}:${tag}`]);
return exitCode === 0;
try {
const { exitCode } = await execa('docker', ['manifest', 'inspect', `${image}:${tag}`]);
return exitCode === 0;
} catch (err) {
const { stderr } = err;
if (stderr === `no such manifest: docker.io/${image}:${tag}`) {
return false;
}
throw err;
}
}

async function dockerCreateTag(image, srcTag, destTags) {
Expand Down Expand Up @@ -53,7 +61,7 @@ async function showFile(commit, file) {
return stdout;
}

async function main({ yes, force, commit, releaseTag, 'no-latest': noLatest, ...rest }) {
async function main({ yes, force, commit, releaseTag, 'no-latest': noLatest }) {
const { default: chalk } = await import('chalk');

if (!commit) {
Expand Down Expand Up @@ -84,7 +92,7 @@ async function main({ yes, force, commit, releaseTag, 'no-latest': noLatest, ...
type: 'input',
async default() {
const lernaJson = JSON.parse(await showFile(commit, 'lerna.json'));
return lernaJson.version;
return `v${lernaJson.version}`;
},
},
]);
Expand Down

0 comments on commit 1bc11c2

Please sign in to comment.