Merge pull request #114 from waku-org/ci/docker-with-pnpm

ci: use Docker image with pnpm installed
This commit is contained in:
fryorcraken.eth 2022-09-24 06:36:45 +10:00 committed by GitHub
commit 7f8e019a11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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}"
}