From a193fdba6fea3fa9438b2522f9f7b4c6a844ec93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 23 Sep 2022 17:19:51 +0200 Subject: [PATCH] ci: use Docker image with pnpm installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ci/Dockerfile | 13 +++++++++++++ ci/Jenkinsfile | 14 ++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 ci/Dockerfile diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..1db58d4 --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16-alpine3.16 + +LABEL maintainer="jakub@status.im" + +RUN apk --no-cache add openssh git + +RUN npm install -g pnpm + +# Jenkins user needs a specific UID/GID to work +RUN addgroup -g 1001 jenkins \ + && adduser -u 1001 -G jenkins -D jenkins +USER jenkins +ENV HOME="/home/jenkins" diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 375c7e0..475355d 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -1,5 +1,10 @@ pipeline { - agent { label 'linux' } + agent { + dockerfile { + label 'linux' + dir 'ci' + } + } options { disableConcurrentBuilds() @@ -14,13 +19,14 @@ pipeline { SITE_DOMAIN = 'examples.waku.org' GIT_AUTHOR_NAME = 'status-im-auto' GIT_AUTHOR_EMAIL = 'auto@status.im' + GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=no' PUPPETEER_SKIP_DOWNLOAD = 'true' } stages { stage('Pre') { steps { - sh 'yarn install --no-lockfile' + sh 'pnpm install --silent' /* TODO: Build the main page. */ sh 'mkdir -p build/docs' } @@ -63,8 +69,8 @@ pipeline { def buildExample(example=STAGE_NAME) { def dest = "${WORKSPACE}/build/docs/${example}" dir("${example}") { - sh 'yarn install --network-concurrency 1 --no-lockfile' - sh 'yarn run build' + sh 'pnpm install --silent' + sh 'pnpm run build' sh "mkdir -p ${dest}" sh "cp -r build/. ${dest}" }