2021-01-24 21:25:32 +02:00
|
|
|
import { execCommand2, rootDir, gitPullTry, completeReleaseWithChangelog } from './tool-utils';
|
2021-01-04 17:01:45 +02:00
|
|
|
|
|
|
|
const serverDir = `${rootDir}/packages/server`;
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
await gitPullTry();
|
|
|
|
|
2021-01-18 12:13:26 +02:00
|
|
|
process.chdir(serverDir);
|
|
|
|
const version = (await execCommand2('npm version patch')).trim();
|
|
|
|
const versionShort = version.substr(1);
|
2021-01-04 17:01:45 +02:00
|
|
|
const tagName = `server-${version}`;
|
|
|
|
|
2021-01-18 12:13:26 +02:00
|
|
|
process.chdir(rootDir);
|
|
|
|
console.info(`Running from: ${process.cwd()}`);
|
2021-01-04 17:01:45 +02:00
|
|
|
|
2021-01-18 12:13:26 +02:00
|
|
|
await execCommand2(`docker build -t "joplin/server:${versionShort}" -f Dockerfile.server .`);
|
|
|
|
await execCommand2(`docker tag "joplin/server:${versionShort}" "joplin/server:latest"`);
|
|
|
|
await execCommand2(`docker push joplin/server:${versionShort}`);
|
|
|
|
await execCommand2('docker push joplin/server:latest');
|
2021-01-04 17:01:45 +02:00
|
|
|
|
2021-01-24 21:25:32 +02:00
|
|
|
const changelogPath = `${rootDir}/readme/changelog_server.md`;
|
|
|
|
await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server');
|
2021-01-04 17:01:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
main().catch((error) => {
|
|
|
|
console.error('Fatal error');
|
|
|
|
console.error(error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|