diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b901ebe --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,56 @@ +pipeline { + agent { label 'linux' } + + options { + disableConcurrentBuilds() + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '30', + )) + } + + environment { + GIT_COMMITTER_NAME = 'status-im-auto' + GIT_COMMITTER_EMAIL = 'auto@status.im' + /* dev page settings */ + DEV_SITE = 'codex.storage' + DEV_HOST = 'jenkins@node-01.do-ams3.sites.misc.statusim.net' + SCP_OPTS = 'StrictHostKeyChecking=no' + } + + stages { + stage('Install') { + steps { + sh "yarn install" + } + } + + stage('Build') { + steps { + sh "yarn build" + } + } + + stage('Publish Prod') { + when { expression { env.GIT_BRANCH ==~ /.*master/ } } + steps { + sshagent(credentials: ['status-im-auto-ssh']) { + sh "ghp-import -p build" + } + } + } + + stage('Publish Devel') { + when { expression { env.GIT_BRANCH ==~ /.*develop/ } } + steps { + sshagent(credentials: ['jenkins-ssh']) { + sh """ + rsync -e 'ssh -o ${SCP_OPTS}' -r --delete build/. \ + ${env.DEV_HOST}:/var/www/${env.DEV_SITE}/ + """ + } + } + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 9b9211a..87070cd 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,14 @@ $ yarn $ yarn start ``` -## Deployment -1. Clone this repository. -2. Install the dependencies: -```bash -$ yarn -``` -3. Build the website: -```bash -$ yarn build -``` -4. serve the app: -```bash -$ yarn serve -``` +## Continuous Integration + +Two branches are built by [our Jenkins instance](https://ci.infra.status.im/): + +* `master` branch is deployed to https://codex.storage by [CI](https://ci.infra.status.im/job/website/job/codex.storage/). +* `develop` branch is deployed to https://dev.codex.storage by [CI](https://ci.infra.status.im/job/website/job/dev.codex.storage/). + +PRs should be made for `develop` branch and `master` should be [rebased](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) on `develop` once changes are verified. ## Configuration Edit the `docusaurus.config.js` file in the repository's root directory, and update the value of the `businessUnit` field in presets section; below is a list of valid values: diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 0000000..e435997 --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +codex.storage \ No newline at end of file