Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use project name to name docker image and iexec app #69

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PierreJeanjacquot
Copy link
Member

use project name to name docker image and iexec app

  • replace name from package.json (JS specific) with projectName defined in iapp.cof.json
  • new restriction on project name
    • 2 characters min (suitable for docker image name)
    • letters, numbers, hyphens, and space only
    • name must be trimed
  • project name to image name transformation
    • replace space (not supported by docker) by hyphens (space are still allowed in project name because some user like names with spaces...)
    • lowercase name

@@ -38,6 +43,8 @@ export async function deploy() {
throw Error('Invalid version');
}

const imageTag = `${dockerhubUsername}/${projectNameToImageName(projectName)}:${iAppVersion}`;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved up because it can throw and its always good to throw early

Comment on lines -40 to -49
// Read package.json file
export async function readPackageJonConfig() {
try {
const packageContent = await readFile('./package.json', 'utf8');
return JSON.parse(packageContent);
} catch {
throw Error('Failed to read `package.json` file.');
}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get rid of JS template specific code 🎉

Comment on lines +40 to +42
return fromError(e)
.details.map((issue) => issue.message)
.join('; ');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have preferred something simpler but didn't manage to achieve it without printing Validation error. Open for suggestions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant