Skip to content

Commit 6346620

Browse files
committed
add Jenkinsfile, Dockerfile and yarn.lock
Signed-off-by: Jakub Sokołowski <[email protected]>
1 parent cf04f35 commit 6346620

File tree

3 files changed

+86
-1
lines changed

3 files changed

+86
-1
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:22.14-alpine3.21
2+
3+
WORKDIR /app
4+
5+
# Listening port
6+
ARG PORT=3000
7+
EXPOSE ${PORT}
8+
9+
ENV NEXT_TELEMETRY_DISABLED=1
10+
11+
COPY . .
12+
13+
RUN yarn install \
14+
&& yarn cache clean
15+
RUN yarn build
16+
17+
CMD ["yarn", "start"]

Jenkinsfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env groovy
2+
3+
4+
pipeline {
5+
agent { label 'linux' }
6+
7+
parameters {
8+
string(
9+
name: 'IMAGE_TAG',
10+
defaultValue: params.IMAGE_TAG ?: '',
11+
description: 'Optional Docker image tag to push.'
12+
)
13+
}
14+
15+
options {
16+
disableConcurrentBuilds()
17+
/* manage how many builds we keep */
18+
buildDiscarder(logRotator(
19+
numToKeepStr: '20',
20+
daysToKeepStr: '30',
21+
))
22+
}
23+
24+
environment {
25+
IMAGE_NAME = 'statusteam/rln-keystore-management'
26+
NEXT_PUBLIC_SITE_URL = "https://${env.JOB_BASE_NAME}"
27+
}
28+
29+
stages {
30+
stage('Build') {
31+
steps {
32+
script {
33+
image = docker.build("${IMAGE_NAME}:${GIT_COMMIT.take(8)}")
34+
}
35+
}
36+
}
37+
38+
stage('Push') {
39+
steps { script {
40+
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) {
41+
image.push()
42+
}
43+
} }
44+
}
45+
46+
stage('Deploy') {
47+
when { expression { params.IMAGE_TAG != '' } }
48+
steps { script {
49+
withDockerRegistry([credentialsId: 'dockerhub-statusteam-auto', url: '']) {
50+
image.push(params.IMAGE_TAG)
51+
}
52+
} }
53+
}
54+
}
55+
56+
post {
57+
cleanup { cleanWs() }
58+
}
59+
}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,13 @@ If you encounter an "ERC20: insufficient allowance" error, it means the token ap
6464
- [ ] fix membership management methods
6565
- [ ] define epoch / quanity epoch
6666
- [x] alias for individual credentials
67-
- [x] remove export keystore method (if >1 credentials in keystore)
67+
- [x] remove export keystore method (if >1 credentials in keystore)
68+
69+
## CI/CD
70+
71+
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.
72+
73+
- [CI builds](https://ci.infra.status.im/job/website/job/rln.waku.org/) `master` and pushes to `deploy-master` branch, which is hosted at <https://rln.waku.org/>.
74+
- [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 <https://dev-rln.waku.org/>.
75+
76+
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).

0 commit comments

Comments
 (0)