1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/packages/tools/release-server.ts

30 lines
999 B
TypeScript
Raw Normal View History

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();
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}`;
process.chdir(rootDir);
console.info(`Running from: ${process.cwd()}`);
2021-01-04 17:01:45 +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
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);
});