ci: use Docker image with pnpm installed

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-09-23 17:19:51 +02:00
parent c1ccf5a4c7
commit a193fdba6f
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
2 changed files with 23 additions and 4 deletions

13
ci/Dockerfile Normal file
View File

@ -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"

14
ci/Jenkinsfile vendored
View File

@ -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}"
}