You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Server: Add Docker major, minor and beta version tags (#5237)
This commit is contained in:
@@ -27,6 +27,12 @@ async function main() {
|
||||
console.info('Could not get git commit: metadata revision field will be empty');
|
||||
}
|
||||
const buildArgs = `--build-arg BUILD_DATE="${buildDate}" --build-arg REVISION="${revision}" --build-arg VERSION="${imageVersion}"`;
|
||||
const dockerTags: string[] = [];
|
||||
const versionPart = imageVersion.split('.');
|
||||
dockerTags.push(isPreRelease ? 'beta' : 'latest');
|
||||
dockerTags.push(versionPart[0] + (isPreRelease ? '-beta' : ''));
|
||||
dockerTags.push(`${versionPart[0]}.${versionPart[1]}${isPreRelease ? '-beta' : ''}`);
|
||||
dockerTags.push(imageVersion);
|
||||
|
||||
process.chdir(rootDir);
|
||||
console.info(`Running from: ${process.cwd()}`);
|
||||
@@ -34,13 +40,12 @@ async function main() {
|
||||
console.info('tagName:', tagName);
|
||||
console.info('imageVersion:', imageVersion);
|
||||
console.info('isPreRelease:', isPreRelease);
|
||||
console.info('Docker tags:', dockerTags.join(', '));
|
||||
|
||||
await execCommand2(`docker build -t "joplin/server:${imageVersion}" ${buildArgs} -f Dockerfile.server .`);
|
||||
await execCommand2(`docker push joplin/server:${imageVersion}`);
|
||||
|
||||
if (!isPreRelease) {
|
||||
await execCommand2(`docker tag "joplin/server:${imageVersion}" "joplin/server:latest"`);
|
||||
await execCommand2('docker push joplin/server:latest');
|
||||
for (const tag of dockerTags) {
|
||||
await execCommand2(`docker tag "joplin/server:${imageVersion}" "joplin/server:${tag}"`);
|
||||
await execCommand2(`docker push joplin/server:${tag}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user