Skip to content

Commit e858eda

Browse files
feat: parameter to change main db (#472)
1 parent be4c734 commit e858eda

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Jenkinsfile.deploy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ pipeline {
1212
timestamps()
1313
}
1414

15+
parameters {
16+
string(name: 'DB_MAIN_EU', defaultValue: '', description: 'The EU database to use for the main branch')
17+
string(name: 'DB_MAIN_US_WEST', defaultValue: '', description: 'The US West database to use for the main branch')
18+
string(name: 'DB_MAIN_US_EAST', defaultValue: '', description: 'The US East database to use for the main branch')
19+
}
20+
1521
environment {
1622
KV_DEV = credentials('cf-kv-dev')
1723
KV_PROD = credentials('cf-kv-prod')
@@ -78,6 +84,29 @@ pipeline {
7884
}
7985
}
8086
}
87+
stage("Select master db") {
88+
steps {
89+
script {
90+
def setCount = 0
91+
if (params.DB_MAIN_EU != "") setCount++
92+
if (params.DB_MAIN_US_WEST != "") setCount++
93+
if (params.DB_MAIN_US_EAST != "") setCount++
94+
if (setCount > 0 && setCount < 3) {
95+
error("Only some main db params are set. Please set all or none.")
96+
}
97+
98+
if (params.DB_MAIN_EU != "") {
99+
env.TURSO_EU_DB = params.DB_MAIN_EU
100+
}
101+
if (params.DB_MAIN_US_WEST != "") {
102+
env.TURSO_US_WEST_DB = params.DB_MAIN_US_WEST
103+
}
104+
if (params.DB_MAIN_US_EAST != "") {
105+
env.TURSO_US_EAST_DB = params.DB_MAIN_US_EAST
106+
}
107+
}
108+
}
109+
}
81110
stage("Branch db") {
82111
steps {
83112
script {

0 commit comments

Comments
 (0)