From 58c2ac192e962adace836b9968291da9c6baaa3c Mon Sep 17 00:00:00 2001 From: Jakub Date: Fri, 2 Dec 2022 05:51:27 +0100 Subject: [PATCH] ci: add Jenkinsfile for site CI builds (#558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depends on: https://github.com/status-im/infra-misc/commit/4a953922 Resolves: https://github.com/vacp2p/rfc/issues/557 Signed-off-by: Jakub Sokołowski Signed-off-by: Jakub Sokołowski --- README.md | 4 ++++ ci/Dockerfile | 16 ++++++++++++++++ ci/Jenkinsfile | 38 ++++++++++++++++++++++++++++++++++++++ netifly.toml | 6 ------ static/CNAME | 1 + 5 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 ci/Dockerfile create mode 100644 ci/Jenkinsfile delete mode 100644 netifly.toml create mode 100644 static/CNAME diff --git a/README.md b/README.md index 94334d2d..9d496d8c 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ Once installed, the following command can be used to generate the sequence diagr More details on the installation and compilation are given in [mscgenjs repository](https://github.com/mscgenjs/mscgenjs-cli). You may try the online playground https://mscgen.js.org/ as well to get a sense of the output figures. +# Continuous Integration + +The `master` branch is built by [our Jenkins instance](https://ci.infra.status.im/job/website/job/rfc.vac.dev/) and deployed to https://rfc.vac.dev/. + ## Acknowledgement Site layout and process inspired by https://rfc.zeromq.org/ diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..7d9603fd --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:3.17 + +LABEL maintainer="jakub@status.im" +LABEL source="https://github.com/vacp2p/rfc" +LABEL description="rfc.vac.dev build image" + +RUN apk add --no-cache \ + openssh-client-common \ + openssh-client-default \ + git hugo py3-pip + +RUN pip install ghp-import + +# Jenkins user needs a specific UID/GID to work. +RUN addgroup -g 1001 jenkins \ + && adduser -D -u 1001 -G jenkins jenkins diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 00000000..7161e3cc --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + agent { + dockerfile { + label 'linux' + dir 'ci' + } + } + + options { + disableConcurrentBuilds() + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '30', + )) + } + + environment { + GIT_COMMITTER_NAME = 'status-im-auto' + GIT_COMMITTER_EMAIL = 'auto@status.im' + GIT_SSH_COMMAND = 'ssh -o StrictHostKeyChecking=no' + } + + stages { + stage('Build') { + steps { + sh 'hugo' + } + } + + stage('Publish Prod') { + steps { + sshagent(credentials: ['status-im-auto-ssh']) { + sh 'ghp-import -p public' + } + } + } + } +} diff --git a/netifly.toml b/netifly.toml deleted file mode 100644 index 6c10d48a..00000000 --- a/netifly.toml +++ /dev/null @@ -1,6 +0,0 @@ -[build] - command = "hugo" - publish = "public" - -[build.environment] - HUGO_VERSION = "0.80.0" diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 00000000..843608b5 --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +rfc.vac.dev