From d6a18ddb79188a49732cc90e85df2a36883f0598 Mon Sep 17 00:00:00 2001 From: Julian Rother <julian@cccv.de> Date: Thu, 11 Aug 2022 23:08:10 +0200 Subject: [PATCH] Move NodeJS and Meteor install to .gitlab-ci.yml Previously, NodeJS and Meteor versions were hard-coded in a special Dockerfile for building meteor applications. Recently RocketChat began overly precise version checks during the build process. This made regular manual changes of the versions necessary. The versions are now extracted from the source tree. Closes #3 --- .gitlab-ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d43bbc6..87a7d47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,10 +16,25 @@ autoupdate: .build:binary: extends: .build - image: registry.git.cccv.de/infra/packages/docker-images/meteor + image: registry.git.cccv.de/infra/packages/docker-images/bullseye script: - - meteor --version - git clone --depth 1 --branch ${UPSTREAM_VERSION} https://github.com/RocketChat/Rocket.Chat rocketchat + - NODEJS_VERSION="$(jq -r .engines.node rocketchat/package.json)" + - METEOR_VERSION="$(cut -d@ -f2 rocketchat/apps/meteor/.meteor/release)" + - wget -q "https://deb.nodesource.com/node_14.x/pool/main/n/nodejs/nodejs_${NODEJS_VERSION}-deb-1nodesource1_amd64.deb" -O nodejs.deb + - apt-get -qq install ./nodejs.deb + # NodeJS < 14.9.0 did not contain corepack + - test -e /usr/bin/corepack || npm install -g corepack + # Install/enable yarn + - corepack enable + - rm nodejs.deb + - wget -q "https://static-meteor.netdna-ssl.com/packages-bootstrap/${METEOR_VERSION}/meteor-bootstrap-os.linux.x86_64.tar.gz" -O meteor-bootstrap.tar.gz + # The package only contains an ".meteor" directory that ends up in "/root/.meteor" + - tar -C ~/ -xzf meteor-bootstrap.tar.gz + - rm meteor-bootstrap.tar.gz + - export METEOR_ALLOW_SUPERUSER=true + - export PATH=$PATH:/root/.meteor + - meteor --version - cd rocketchat && YARN_CHECKSUM_BEHAVIOR=update yarn install --json && git diff yarn.lock && cd .. - cd rocketchat && yarn build:ci -- --directory $(pwd)/../build && cd .. - cd build/bundle/programs/server/ && npm install --production && cd ../../../.. -- GitLab