From b38c3be3c08c478ab89f41a56efbe571af1e9c01 Mon Sep 17 00:00:00 2001 From: markoburcul Date: Wed, 30 Oct 2024 12:12:32 +0100 Subject: [PATCH] jenkinsfile: allow deploy of dev site Signed-off-by: markoburcul --- Jenkinsfile | 10 +++++++--- README.md | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 269d1ca..55164a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,8 +42,8 @@ pipeline { script { nix.develop(""" ghp-import \ - -b deploy-master \ - -c docs.status.network \ + -b ${deployBranch()} \ + -c ${deployDomain()} \ -p build """, pure: false @@ -57,4 +57,8 @@ pipeline { post { cleanup { cleanWs() } } -} \ No newline at end of file +} + +def isMasterBranch() { GIT_BRANCH ==~ /.*master/ } +def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' } +def deployDomain() { isMasterBranch() ? 'docs.status.network' : 'dev-docs.status.network' } \ No newline at end of file diff --git a/README.md b/README.md index 03a8f5b..eef63bc 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ This command generates static content into the `build` directory and can be serv ## CI/CD - [CI builds](https://ci.infra.status.im/job/website/job/docs.status.network/) `master` and pushes to `deploy-master` branch, which is hosted at . +- [CI builds dev](https://ci.infra.status.im/job/website/job/dev-docs.status.network/) `develop` and pushes to `deploy-develop` branch, which is hosted at . The hosting is done using [Caddy server with Git plugin for handling GitHub webhooks](https://github.com/status-im/infra-misc/blob/master/ansible/roles/caddy-git).