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