diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..387645a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:22.14-alpine3.21 + +WORKDIR /app + +# Listening port +ARG PORT=3000 +EXPOSE ${PORT} + +ENV NEXT_TELEMETRY_DISABLED=1 + +COPY . . + +RUN yarn install \ + && yarn cache clean +RUN yarn build + +CMD ["yarn", "start"] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..08b9033 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,59 @@ +#!/usr/bin/env groovy +library 'status-jenkins-lib@v1.8.8' + +pipeline { + agent { label 'linux' } + + parameters { + string( + name: 'IMAGE_TAG', + defaultValue: params.IMAGE_TAG ?: '', + description: 'Optional Docker image tag to push.' + ) + } + + options { + disableConcurrentBuilds() + /* manage how many builds we keep */ + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '30', + )) + } + + environment { + IMAGE_NAME = 'statusteam/rln-keystore-management' + NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}" + } + + stages { + stage('Build') { + steps { + script { + image = docker.build("${IMAGE_NAME}:${GIT_COMMIT.take(8)}") + } + } + } + + stage('Push') { + steps { script { + withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { + image.push() + } + } } + } + + stage('Deploy') { + when { expression { params.IMAGE_TAG != '' } } + steps { script { + withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) { + image.push(params.IMAGE_TAG) + } + } } + } + } + + post { + cleanup { cleanWs() } + } +} diff --git a/README.md b/README.md index b6079cf..e58ad43 100644 --- a/README.md +++ b/README.md @@ -64,4 +64,13 @@ If you encounter an "ERC20: insufficient allowance" error, it means the token ap - [ ] fix membership management methods - [ ] define epoch / quanity epoch - [x] alias for individual credentials -- [x] remove export keystore method (if >1 credentials in keystore) \ No newline at end of file +- [x] remove export keystore method (if >1 credentials in keystore) + +## CI/CD + +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. + +- [CI builds](https://ci.infra.status.im/job/website/job/rln.waku.org/) `master` and pushes to `deploy-master` branch, which is hosted at . +- [CI builds](https://ci.infra.status.im/job/website/job/dev-rln.waku.org/) `develop` and pushes to `deploy-develop` branch, which is hosted at . + +The hosting is done using [`nextjs-website` Ansible role in `infra-sites`](https://github.com/status-im/infra-sites/blob/master/ansible/vars/press/rln_waku_org.yml).