Skip to content

Commit ab90642

Browse files
authored
fix: unsupported versions gap (#292)
1 parent 5f8d608 commit ab90642

4 files changed

Lines changed: 274 additions & 2 deletions

File tree

7.11/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM node:22-bookworm-slim
2+
3+
ENV DENO_VERSION=1.43.5
4+
5+
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
6+
&& case "${dpkgArch##*-}" in \
7+
amd64) ARCH='x86_64';; \
8+
arm64) ARCH='aarch64';; \
9+
*) echo "unsupported Deno architecture"; exit 1 ;; \
10+
esac \
11+
&& set -ex \
12+
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates curl unzip && rm -rf /var/lib/apt/lists/* \
13+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-${ARCH}-unknown-linux-gnu.zip --output /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
14+
&& echo "246bf818932c5e11adb85afaaf3c90e65d5cbe14bcaa8ea14d35fc085869775d /tmp/deno-x86_64-unknown-linux-gnu.zip" | sha256sum -c - \
15+
&& unzip /tmp/deno-${ARCH}-unknown-linux-gnu.zip -d /tmp \
16+
&& rm /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
17+
&& chmod 755 /tmp/deno \
18+
&& mv /tmp/deno /usr/local/bin/deno \
19+
&& apt-mark auto '.*' > /dev/null \
20+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
21+
| awk '/=>/ { print $(NF-1) }' \
22+
| sort -u \
23+
| xargs -r dpkg-query --search \
24+
| cut -d: -f1 \
25+
| sort -u \
26+
| xargs -r apt-mark manual \
27+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
28+
29+
RUN groupadd -r rocketchat \
30+
&& useradd -r -g rocketchat rocketchat \
31+
&& mkdir -p /app/uploads \
32+
&& chown rocketchat:rocketchat /app/uploads
33+
34+
VOLUME /app/uploads
35+
36+
WORKDIR /app
37+
38+
ENV NODE_ENV=production
39+
40+
ENV RC_VERSION=7.11.7
41+
42+
RUN set -eux \
43+
&& apt-get update \
44+
&& apt-get install -y --no-install-recommends fontconfig \
45+
&& aptMark="$(apt-mark showmanual)" \
46+
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates curl gnupg \
47+
&& rm -rf /var/lib/apt/lists/* \
48+
# gpg: key 4FD08104: public key "Rocket.Chat Buildmaster <buildmaster@rocket.chat>" imported
49+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0E163286C20D07B9787EBE9FD7F9D0414FD08104 \
50+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/download" -o rocket.chat.tgz \
51+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \
52+
&& gpg --batch --verify rocket.chat.tgz.asc rocket.chat.tgz \
53+
&& tar zxf rocket.chat.tgz \
54+
&& rm rocket.chat.tgz rocket.chat.tgz.asc \
55+
&& cd bundle/programs/server \
56+
&& npm install --unsafe-perm=true \
57+
&& apt-mark auto '.*' > /dev/null \
58+
&& apt-mark manual $aptMark > /dev/null \
59+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
60+
| awk '/=>/ { print $(NF-1) }' \
61+
| sort -u \
62+
| xargs -r dpkg-query --search \
63+
| cut -d: -f1 \
64+
| sort -u \
65+
| xargs -r apt-mark manual \
66+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
67+
&& npm cache clear --force \
68+
&& chown -R rocketchat:rocketchat /app
69+
70+
USER rocketchat
71+
72+
WORKDIR /app/bundle
73+
74+
# needs a mongoinstance - defaults to container linking with alias 'db'
75+
ENV DEPLOY_METHOD=docker-official \
76+
MONGO_URL=mongodb://db:27017/meteor \
77+
HOME=/tmp \
78+
PORT=3000 \
79+
ROOT_URL=http://localhost:3000
80+
81+
EXPOSE 3000
82+
83+
CMD ["node", "main.js"]

7.12/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM node:22-bookworm-slim
2+
3+
ENV DENO_VERSION=1.43.5
4+
5+
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
6+
&& case "${dpkgArch##*-}" in \
7+
amd64) ARCH='x86_64';; \
8+
arm64) ARCH='aarch64';; \
9+
*) echo "unsupported Deno architecture"; exit 1 ;; \
10+
esac \
11+
&& set -ex \
12+
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates curl unzip && rm -rf /var/lib/apt/lists/* \
13+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-${ARCH}-unknown-linux-gnu.zip --output /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
14+
&& echo "246bf818932c5e11adb85afaaf3c90e65d5cbe14bcaa8ea14d35fc085869775d /tmp/deno-x86_64-unknown-linux-gnu.zip" | sha256sum -c - \
15+
&& unzip /tmp/deno-${ARCH}-unknown-linux-gnu.zip -d /tmp \
16+
&& rm /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
17+
&& chmod 755 /tmp/deno \
18+
&& mv /tmp/deno /usr/local/bin/deno \
19+
&& apt-mark auto '.*' > /dev/null \
20+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
21+
| awk '/=>/ { print $(NF-1) }' \
22+
| sort -u \
23+
| xargs -r dpkg-query --search \
24+
| cut -d: -f1 \
25+
| sort -u \
26+
| xargs -r apt-mark manual \
27+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
28+
29+
RUN groupadd -r rocketchat \
30+
&& useradd -r -g rocketchat rocketchat \
31+
&& mkdir -p /app/uploads \
32+
&& chown rocketchat:rocketchat /app/uploads
33+
34+
VOLUME /app/uploads
35+
36+
WORKDIR /app
37+
38+
ENV NODE_ENV=production
39+
40+
ENV RC_VERSION=7.12.7
41+
42+
RUN set -eux \
43+
&& apt-get update \
44+
&& apt-get install -y --no-install-recommends fontconfig \
45+
&& aptMark="$(apt-mark showmanual)" \
46+
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates curl gnupg \
47+
&& rm -rf /var/lib/apt/lists/* \
48+
# gpg: key 4FD08104: public key "Rocket.Chat Buildmaster <buildmaster@rocket.chat>" imported
49+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0E163286C20D07B9787EBE9FD7F9D0414FD08104 \
50+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/download" -o rocket.chat.tgz \
51+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \
52+
&& gpg --batch --verify rocket.chat.tgz.asc rocket.chat.tgz \
53+
&& tar zxf rocket.chat.tgz \
54+
&& rm rocket.chat.tgz rocket.chat.tgz.asc \
55+
&& cd bundle/programs/server \
56+
&& npm install --unsafe-perm=true \
57+
&& apt-mark auto '.*' > /dev/null \
58+
&& apt-mark manual $aptMark > /dev/null \
59+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
60+
| awk '/=>/ { print $(NF-1) }' \
61+
| sort -u \
62+
| xargs -r dpkg-query --search \
63+
| cut -d: -f1 \
64+
| sort -u \
65+
| xargs -r apt-mark manual \
66+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
67+
&& npm cache clear --force \
68+
&& chown -R rocketchat:rocketchat /app
69+
70+
USER rocketchat
71+
72+
WORKDIR /app/bundle
73+
74+
# needs a mongoinstance - defaults to container linking with alias 'db'
75+
ENV DEPLOY_METHOD=docker-official \
76+
MONGO_URL=mongodb://db:27017/meteor \
77+
HOME=/tmp \
78+
PORT=3000 \
79+
ROOT_URL=http://localhost:3000
80+
81+
EXPOSE 3000
82+
83+
CMD ["node", "main.js"]

7.13/Dockerfile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
FROM node:22-bookworm-slim
2+
3+
ENV DENO_VERSION=1.43.5
4+
5+
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
6+
&& case "${dpkgArch##*-}" in \
7+
amd64) ARCH='x86_64';; \
8+
arm64) ARCH='aarch64';; \
9+
*) echo "unsupported Deno architecture"; exit 1 ;; \
10+
esac \
11+
&& set -ex \
12+
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates curl unzip && rm -rf /var/lib/apt/lists/* \
13+
&& curl -fsSL https://dl.deno.land/release/v${DENO_VERSION}/deno-${ARCH}-unknown-linux-gnu.zip --output /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
14+
&& echo "246bf818932c5e11adb85afaaf3c90e65d5cbe14bcaa8ea14d35fc085869775d /tmp/deno-x86_64-unknown-linux-gnu.zip" | sha256sum -c - \
15+
&& unzip /tmp/deno-${ARCH}-unknown-linux-gnu.zip -d /tmp \
16+
&& rm /tmp/deno-${ARCH}-unknown-linux-gnu.zip \
17+
&& chmod 755 /tmp/deno \
18+
&& mv /tmp/deno /usr/local/bin/deno \
19+
&& apt-mark auto '.*' > /dev/null \
20+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
21+
| awk '/=>/ { print $(NF-1) }' \
22+
| sort -u \
23+
| xargs -r dpkg-query --search \
24+
| cut -d: -f1 \
25+
| sort -u \
26+
| xargs -r apt-mark manual \
27+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
28+
29+
RUN groupadd -r rocketchat \
30+
&& useradd -r -g rocketchat rocketchat \
31+
&& mkdir -p /app/uploads \
32+
&& chown rocketchat:rocketchat /app/uploads
33+
34+
VOLUME /app/uploads
35+
36+
WORKDIR /app
37+
38+
ENV NODE_ENV=production
39+
40+
ENV RC_VERSION=7.13.9
41+
42+
RUN set -eux \
43+
&& apt-get update \
44+
&& apt-get install -y --no-install-recommends fontconfig \
45+
&& aptMark="$(apt-mark showmanual)" \
46+
&& apt-get install -y --no-install-recommends g++ make python3 ca-certificates curl gnupg \
47+
&& rm -rf /var/lib/apt/lists/* \
48+
# gpg: key 4FD08104: public key "Rocket.Chat Buildmaster <buildmaster@rocket.chat>" imported
49+
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0E163286C20D07B9787EBE9FD7F9D0414FD08104 \
50+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/download" -o rocket.chat.tgz \
51+
&& curl -fSL "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \
52+
&& gpg --batch --verify rocket.chat.tgz.asc rocket.chat.tgz \
53+
&& tar zxf rocket.chat.tgz \
54+
&& rm rocket.chat.tgz rocket.chat.tgz.asc \
55+
&& cd bundle/programs/server \
56+
&& npm install --unsafe-perm=true \
57+
&& apt-mark auto '.*' > /dev/null \
58+
&& apt-mark manual $aptMark > /dev/null \
59+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
60+
| awk '/=>/ { print $(NF-1) }' \
61+
| sort -u \
62+
| xargs -r dpkg-query --search \
63+
| cut -d: -f1 \
64+
| sort -u \
65+
| xargs -r apt-mark manual \
66+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
67+
&& npm cache clear --force \
68+
&& chown -R rocketchat:rocketchat /app
69+
70+
USER rocketchat
71+
72+
WORKDIR /app/bundle
73+
74+
# needs a mongoinstance - defaults to container linking with alias 'db'
75+
ENV DEPLOY_METHOD=docker-official \
76+
MONGO_URL=mongodb://db:27017/meteor \
77+
HOME=/tmp \
78+
PORT=3000 \
79+
ROOT_URL=http://localhost:3000
80+
81+
EXPOSE 3000
82+
83+
CMD ["node", "main.js"]

build-automation.mjs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,22 @@ const getSupportedVersions = async (github) => {
2929

3030
const latest = acc.get(minor) || 0;
3131

32-
acc.set(minor, latest > patch ? latest : patch);
32+
acc.set(minor, Number(latest) > Number(patch) ? latest : patch);
3333

3434
return acc;
3535
}, new Map());
3636
return groupedReleases;
3737
};
3838

39+
const getMinor = (version) => version.split('.').slice(0, 2).join('.');
40+
41+
const compareMinors = (a, b) => {
42+
const [aMajor, aMinor] = a.split('.').map(Number);
43+
const [bMajor, bMinor] = b.split('.').map(Number);
44+
45+
return (aMajor - bMajor) || (aMinor - bMinor);
46+
};
47+
3948
const removeCurrentVersions = async () => {
4049
const versionsOutput = await getCurrentFolders();
4150

@@ -63,9 +72,23 @@ export default async function(github) {
6372
process.exit(0);
6473
}
6574

75+
// keep publishing minors that left the supported list while an older minor
76+
// (e.g. an old LTS) is still supported, frozen at their last published patch
77+
const oldestSupportedMinor = Array.from(supportedVersions.keys()).sort(compareMinors)[0];
78+
79+
const versionsToBuild = new Map(supportedVersions);
80+
81+
for (const version of currentVersions) {
82+
const minor = getMinor(version);
83+
84+
if (!versionsToBuild.has(minor) && compareMinors(minor, oldestSupportedMinor) > 0) {
85+
versionsToBuild.set(minor, version.split('.')[2]);
86+
}
87+
}
88+
6689
await removeCurrentVersions();
6790

68-
for await (const [minor, patch] of supportedVersions) {
91+
for await (const [minor, patch] of versionsToBuild) {
6992
const fullVersion = `${minor}.${patch}`;
7093

7194
const { data: info } = await github.request(`https://releases.rocket.chat/${fullVersion}/info`);

0 commit comments

Comments
 (0)