-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathJenkinsfile.website
More file actions
111 lines (102 loc) · 2.65 KB
/
Jenkinsfile.website
File metadata and controls
111 lines (102 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env groovy
library 'status-jenkins-lib@v1.9.40'
pipeline {
agent {
docker {
label 'linuxcontainer'
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
args '--volume=/nix:/nix ' +
'--volume=/etc/nix:/etc/nix '
}
}
options {
disableConcurrentBuilds()
disableRestartFromStage()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '20',
daysToKeepStr: '30',
))
}
parameters {
choice(
name: 'APP_NAME',
description: 'Name of app from apps folder.',
choices: ['hub'],
)
string(
name: 'NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID',
description: 'WalletConnect project ID for Web3 connectivity.',
defaultValue: params.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID ?: ''
)
string(
name: 'NEXT_PUBLIC_STATUS_NETWORK_API_URL',
description: 'Status Network API URL',
defaultValue: params.NEXT_PUBLIC_STATUS_NETWORK_API_URL ?: 'https://api-dev.status.network/api/v1'
)
string(
name: 'NEXT_PUBLIC_STATUS_API_URL',
description: 'Status API URL',
defaultValue: params.NEXT_PUBLIC_STATUS_API_URL ?: 'https://api-dev.status.network'
)
}
environment {
GIT_COMMITTER_NAME = 'status-im-auto'
GIT_COMMITTER_EMAIL = 'auto@status.im'
}
stages {
stage('Install') {
steps {
dir("${env.WORKSPACE}/apps/${params.APP_NAME}") {
script {
nix.develop(
'pnpm install --frozen-lockfile --aggregate-output',
pure: false,
)
}
}
}
}
stage('Build') {
steps {
script {
nix.develop(
'pnpm build',
pure: false,
)
}
dir("${env.WORKSPACE}/apps/${params.APP_NAME}") {
script {
nix.develop(
'pnpm build',
pure: false,
)
jenkins.genBuildMetaJSON('out/build.json')
}
}
}
}
stage('Publish') {
steps {
sshagent(credentials: ['status-im-auto-ssh']) {
script {
nix.develop("""
ghp-import \
-b ${deployBranch()} \
-c ${deployDomain()} \
-p apps/${params.APP_NAME}/out
""",
pure: false,
)
}
}
}
}
}
post {
cleanup { cleanWs() }
}
}
def isMainBranch() { GIT_BRANCH ==~ /.*main/ }
def deployBranch() { isMainBranch() ? 'deploy-hub-main' : 'deploy-hub-develop' }
def deployDomain() { isMainBranch() ? 'hub.status.network' : 'dev.hub.status.network' }