From 3c13c8d0806e7d52a191b015cbf1185847c18bb0 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 23 Sep 2021 17:13:54 +0100 Subject: [PATCH] Tools: Allow tagging a server release as "latest" --- .eslintignore | 3 ++ .gitignore | 3 ++ package.json | 1 + packages/tools/release-server.ts | 6 +++- packages/tools/tagServerLatest.ts | 20 +++++++++++ readme/changelog_server.md | 60 +++++++++++++++---------------- 6 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 packages/tools/tagServerLatest.ts diff --git a/.eslintignore b/.eslintignore index b958b54be..98a26ca19 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1852,6 +1852,9 @@ packages/tools/release-server.js.map packages/tools/setupNewRelease.d.ts packages/tools/setupNewRelease.js packages/tools/setupNewRelease.js.map +packages/tools/tagServerLatest.d.ts +packages/tools/tagServerLatest.js +packages/tools/tagServerLatest.js.map packages/tools/tool-utils.d.ts packages/tools/tool-utils.js packages/tools/tool-utils.js.map diff --git a/.gitignore b/.gitignore index 03f738081..c5ea28c9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1837,6 +1837,9 @@ packages/tools/release-server.js.map packages/tools/setupNewRelease.d.ts packages/tools/setupNewRelease.js packages/tools/setupNewRelease.js.map +packages/tools/tagServerLatest.d.ts +packages/tools/tagServerLatest.js +packages/tools/tagServerLatest.js.map packages/tools/tool-utils.d.ts packages/tools/tool-utils.js packages/tools/tool-utils.js.map diff --git a/package.json b/package.json index 1ab940b48..6439074ac 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "releaseIOS": "node packages/tools/release-ios.js", "releasePluginGenerator": "node packages/tools/release-plugin-generator.js", "releaseServer": "node packages/tools/release-server.js", + "tagServerLatest": "node packages/tools/tagServerLatest.js", "buildServerDocker": "node packages/tools/buildServerDocker.js", "setupNewRelease": "node ./packages/tools/setupNewRelease", "test-ci": "lerna run test-ci --stream", diff --git a/packages/tools/release-server.ts b/packages/tools/release-server.ts index 5b1aed315..e41975b21 100644 --- a/packages/tools/release-server.ts +++ b/packages/tools/release-server.ts @@ -15,7 +15,11 @@ async function main() { const tagName = `server-${version}${versionSuffix}`; const changelogPath = `${rootDir}/readme/changelog_server.md`; - await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server', isPreRelease); + + // We don't mark the changelog entry as pre-release because they all are + // initially. It's only after a number of days once it's clear that the + // release is stable that it is marked as "latest". + await completeReleaseWithChangelog(changelogPath, version, tagName, 'Server', false); } main().catch((error) => { diff --git a/packages/tools/tagServerLatest.ts b/packages/tools/tagServerLatest.ts new file mode 100644 index 000000000..abbc1a57b --- /dev/null +++ b/packages/tools/tagServerLatest.ts @@ -0,0 +1,20 @@ +import { execCommand2 } from './tool-utils'; + +async function main() { + const argv = require('yargs').argv; + if (!argv._.length) throw new Error('Version number is required'); + + const version = argv._[0]; + + await execCommand2(`docker pull "joplin/server:${version}"`); + await execCommand2(`docker tag "joplin/server:${version}" "joplin/server:latest"`); + await execCommand2('docker push joplin/server:latest'); +} + +if (require.main === module) { + main().catch((error) => { + console.error('Fatal error'); + console.error(error); + process.exit(1); + }); +} diff --git a/readme/changelog_server.md b/readme/changelog_server.md index 8d1d3fd70..6ff31d2a3 100644 --- a/readme/changelog_server.md +++ b/readme/changelog_server.md @@ -1,6 +1,6 @@ # Joplin Server Changelog -## [server-v2.4.9-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.4.9-beta) (Pre-release) - 2021-09-22T16:31:23Z +## [server-v2.4.9](https://github.com/laurent22/joplin/releases/tag/server-v2.4.9-beta) - 2021-09-22T16:31:23Z - New: Add support for changing user own email (63e88c0) - Improved: Allow an admin to impersonate a user (03b4b6e) @@ -17,21 +17,21 @@ - Improved: Sync deleted items first to allow fixing oversized accounts (43c594b) - Fixed: Fixed calculating total item size after an item has been deleted (024967c) -## [server-v2.4.8-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.4.8-beta) (Pre-release) - 2021-09-15T22:16:59Z +## [server-v2.4.8](https://github.com/laurent22/joplin/releases/tag/server-v2.4.8-beta) - 2021-09-15T22:16:59Z - New: Added support for app level slow SQL query log (5e8b742) -## [server-v2.4.7-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.4.7-beta) (Pre-release) - 2021-09-15T15:58:46Z +## [server-v2.4.7](https://github.com/laurent22/joplin/releases/tag/server-v2.4.7-beta) - 2021-09-15T15:58:46Z - Improved: Improve flag logic (c229821) - Fixed: Fixed handling of brute force limiter by getting correct user IP (3ce947e) -## [server-v2.4.6-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.4.6-beta) (Pre-release) - 2021-09-14T15:02:21Z +## [server-v2.4.6](https://github.com/laurent22/joplin/releases/tag/server-v2.4.6-beta) - 2021-09-14T15:02:21Z - New: Add link to Stripe subscription page to manage payment details (4e7fe66) - New: Add transaction info to debug deadlock issues (01b653f) -## [server-v2.4.3-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.4.3-beta) (Pre-release) - 2021-09-02T17:49:11Z +## [server-v2.4.3](https://github.com/laurent22/joplin/releases/tag/server-v2.4.3-beta) - 2021-09-02T17:49:11Z - New: Added Help page for Joplin Cloud (6520a48) - New: Added icon next to profile button (5805a41) @@ -54,19 +54,19 @@ - Fixed: Fix missing CSS file error (#5309 by [@whalehub](https://github.com/whalehub)) - Fixed: Fixed second duration (c7421df) -## [server-v2.3.7-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.3.7-beta) (Pre-release) - 2021-08-13T21:20:17Z +## [server-v2.3.7](https://github.com/laurent22/joplin/releases/tag/server-v2.3.7-beta) - 2021-08-13T21:20:17Z - Fixed: Fix migrations (a9961ae) -## [server-v2.3.6-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.3.6-beta) (Pre-release) - 2021-08-13T20:59:41Z +## [server-v2.3.6](https://github.com/laurent22/joplin/releases/tag/server-v2.3.6-beta) - 2021-08-13T20:59:41Z - Fixed: Fix migrations (f518549) -## [server-v2.3.5-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.3.5-beta) (Pre-release) - 2021-08-13T18:01:20Z +## [server-v2.3.5](https://github.com/laurent22/joplin/releases/tag/server-v2.3.5-beta) - 2021-08-13T18:01:20Z - Fixed: Fixed pagination link styling (d42d181) -## [server-v2.3.4-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.3.4-beta) (Pre-release) - 2021-08-13T16:56:17Z +## [server-v2.3.4](https://github.com/laurent22/joplin/releases/tag/server-v2.3.4-beta) - 2021-08-13T16:56:17Z - Improved: Allow setting email key to prevent the same email to be sent multiple times (391204c) - Improved: Clarify beta transition message (c4fcfec) @@ -77,7 +77,7 @@ - Fixed: Fix regression (6359c9c) - Fixed: Fixed layout of notes on mobile devices (#5269) -## [server-v2.2.11-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.11-beta) (Pre-release) - 2021-08-03T18:48:00Z +## [server-v2.2.11](https://github.com/laurent22/joplin/releases/tag/server-v2.2.11-beta) - 2021-08-03T18:48:00Z - Improved: Disable beta account once expired (785248b) - Improved: Handle beta user upgrade (8910c87) @@ -88,7 +88,7 @@ - Improved: Allows providing a coupon when creating the Stripe checkout session (b5b6111) -## [server-v2.2.9-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.9-beta) (Pre-release) - 2021-07-31T13:52:53Z +## [server-v2.2.9](https://github.com/laurent22/joplin/releases/tag/server-v2.2.9-beta) - 2021-07-31T13:52:53Z - New: Add Docker major, minor and beta version tags (#5237 by [@JackGruber](https://github.com/JackGruber)) - New: Add support for Stripe yearly subscriptions (f2547fe) @@ -96,7 +96,7 @@ - Fixed: Fixed certain URLs (282f782) - Fixed: Published notes that contain non-alphabetical characters could end up being truncated (#5229) -## [server-v2.2.8-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.8-beta) (Pre-release) - 2021-07-24T16:55:58Z +## [server-v2.2.8](https://github.com/laurent22/joplin/releases/tag/server-v2.2.8-beta) - 2021-07-24T16:55:58Z - New: Added form tokens to prevent CSRF attacks (CVE-2021-23431) (19b45de) - Improved: Allow admin to change Stripe subscription (75a421e) @@ -110,37 +110,37 @@ - Improved: Moved email templates to separate files (6a93cb2) - Improved: Set default of env SUPPORT_EMAIL to "SUPPORT_EMAIL" to make it clear it needs to be set (92520e5) -## [server-v2.2.7-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.7-beta) (Pre-release) - 2021-07-11T17:31:42Z +## [server-v2.2.7](https://github.com/laurent22/joplin/releases/tag/server-v2.2.7-beta) - 2021-07-11T17:31:42Z - New: Added support for resetting user password (62b6198) - Improved: Check password complexity (240cb35) - Improved: Disallow changing email address until a secure solution to change it is implemented (f8d2c26) - Fixed: Fixed mail queue as some emails were not being processed (89f4ca1) -## [server-v2.2.6-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.6-beta) (Pre-release) - 2021-07-09T15:57:47Z +## [server-v2.2.6](https://github.com/laurent22/joplin/releases/tag/server-v2.2.6-beta) - 2021-07-09T15:57:47Z - New: Add Docker image labels (#5158 by [@JackGruber](https://github.com/JackGruber)) - Fixed: Fixed change processing logic (5a27d4d) - Fixed: Fixed styling of shared note (6c1a6b0) -## [server-v2.2.5-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.5-beta) (Pre-release) - 2021-07-03T21:40:37Z +## [server-v2.2.5](https://github.com/laurent22/joplin/releases/tag/server-v2.2.5-beta) - 2021-07-03T21:40:37Z - Improved: Make app context immutable and derive the per-request context properties from it (e210926) -## [server-v2.2.4-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.4-beta) (Pre-release) - 2021-07-03T21:10:29Z +## [server-v2.2.4](https://github.com/laurent22/joplin/releases/tag/server-v2.2.4-beta) - 2021-07-03T21:10:29Z - Fixed: Fixed issue with user sessions being mixed up (238cc86) -## [server-v2.2.3-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.3-beta) (Pre-release) - 2021-07-03T19:38:36Z +## [server-v2.2.3](https://github.com/laurent22/joplin/releases/tag/server-v2.2.3-beta) - 2021-07-03T19:38:36Z - Fixed: Fixed size of a database field (264f36f) -## [server-v2.2.2-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.2-beta) (Pre-release) - 2021-07-03T18:28:35Z +## [server-v2.2.2](https://github.com/laurent22/joplin/releases/tag/server-v2.2.2-beta) - 2021-07-03T18:28:35Z - Improved: Improved logging and reliability of cron tasks (d99c34f) - Improved: Only emit "created" event when new user is saved (8883df2) -## [server-v2.2.1-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.2.1-beta) (Pre-release) - 2021-07-03T15:41:32Z +## [server-v2.2.1](https://github.com/laurent22/joplin/releases/tag/server-v2.2.1-beta) - 2021-07-03T15:41:32Z - New: Add support for account max total size (b507fbf) - Improved: Display max size info in dashboard (3d18514) @@ -149,21 +149,21 @@ - Improved: Normalize email addresses before saving them (427218b) - Improved: Remove dangerous "Delete all" button for now (125af75) -## [server-v2.1.6-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.1.6-beta) (Pre-release) - 2021-06-24T10:01:46Z +## [server-v2.1.6](https://github.com/laurent22/joplin/releases/tag/server-v2.1.6-beta) - 2021-06-24T10:01:46Z - Fixed: Fixed accessing main website (Regression) (f868797) -## [server-v2.1.5-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.1.5-beta) (Pre-release) - 2021-06-24T08:26:38Z +## [server-v2.1.5](https://github.com/laurent22/joplin/releases/tag/server-v2.1.5-beta) - 2021-06-24T08:26:38Z - New: Add support for X-API-MIN-VERSION header (51f3c00) -## [server-v2.1.4-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.1.4-beta) (Pre-release) - 2021-06-24T07:26:03Z +## [server-v2.1.4](https://github.com/laurent22/joplin/releases/tag/server-v2.1.4-beta) - 2021-06-24T07:26:03Z - Improved: Split permission to share note or folder (0c12c7f) - Fixed: Fixed handling of max item size for encrypted items (112157e) - Fixed: Fixed transaction locking issue when a sub-transaction fails (12aae48) -## [server-v2.1.3-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.1.3-beta) (Pre-release) - 2021-06-19T14:15:06Z +## [server-v2.1.3](https://github.com/laurent22/joplin/releases/tag/server-v2.1.3-beta) - 2021-06-19T14:15:06Z - New: Add support for uploading multiple items in one request (3b9c02e) @@ -198,14 +198,14 @@ - Improved: Handle custom user content URLs (a36b13d) - Fixed: Fixed error when creating user (594084e) -## [server-v2.0.9-beta](https://github.com/laurent22/joplin/releases/tag/server-v2.0.9-beta) (Pre-release) - 2021-06-11T16:49:05Z +## [server-v2.0.9](https://github.com/laurent22/joplin/releases/tag/server-v2.0.9-beta) - 2021-06-11T16:49:05Z - New: Add navbar on login and sign up page (7a3a208) - New: Added option to enable or disable stack traces (5614eb9) - Improved: Handle custom user content URLs (a36b13d) - Fixed: Fixed error when creating user (594084e) -## [server-v2.0.6](https://github.com/laurent22/joplin/releases/tag/server-v2.0.6) (Pre-release) - 2021-06-07T17:27:27Z +## [server-v2.0.6](https://github.com/laurent22/joplin/releases/tag/server-v2.0.6) - 2021-06-07T17:27:27Z - New: Add Stripe integration (770af6a) - New: Add request duration to log (c8d7ecb) @@ -214,21 +214,21 @@ - Improved: Check share ID when uploading a note (3c41b45) - Improved: Load shared user content from correct domain (de45740) -## [server-v2.0.5](https://github.com/laurent22/joplin/releases/tag/server-v2.0.5) (Pre-release) - 2021-06-02T08:14:47Z +## [server-v2.0.5](https://github.com/laurent22/joplin/releases/tag/server-v2.0.5) - 2021-06-02T08:14:47Z - New: Add version number on website (0ef7e98) - New: Added signup pages (41ed66d) - Improved: Allow disabling item upload for a user (f8a26cf) -## [server-v2.0.4](https://github.com/laurent22/joplin/releases/tag/server-v2.0.4) (Pre-release) - 2021-05-25T18:33:11Z +## [server-v2.0.4](https://github.com/laurent22/joplin/releases/tag/server-v2.0.4) - 2021-05-25T18:33:11Z - Fixed: Fixed Item and Log page when using Postgres (ee0f237) -## [server-v2.0.3](https://github.com/laurent22/joplin/releases/tag/server-v2.0.3) (Pre-release) - 2021-05-25T18:08:46Z +## [server-v2.0.3](https://github.com/laurent22/joplin/releases/tag/server-v2.0.3) - 2021-05-25T18:08:46Z - Fixed: Fixed handling of request origin (12a6634) -## [server-v2.0.2](https://github.com/laurent22/joplin/releases/tag/server-v2.0.2) (Pre-release) - 2021-05-25T19:15:50Z +## [server-v2.0.2](https://github.com/laurent22/joplin/releases/tag/server-v2.0.2) - 2021-05-25T19:15:50Z - New: Add mailer service (ed8ee67) - New: Add support for item size limit (6afde54) @@ -248,7 +248,7 @@ - Fixed: Fixed deleting a note that has been shared (489995d) - Fixed: Make sure temp files are deleted after upload is done (#4540) -## [server-v2.0.1](https://github.com/laurent22/joplin/releases/tag/server-v2.0.1) (Pre-release) - 2021-05-14T13:55:45Z +## [server-v2.0.1](https://github.com/laurent22/joplin/releases/tag/server-v2.0.1) - 2021-05-14T13:55:45Z - New: Add support for sharing notes via a link (ccbc329) - New: Add support for sharing a folder (#4772)