Skip to content

Commit

Permalink
refresh of pipelines to use simpler ?: params check
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 1, 2022
1 parent 59d0430 commit 16d0bc5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 38 deletions.
15 changes: 6 additions & 9 deletions tools/jenkins/midpoint-main-generic-pg-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* and European Union Public License. See LICENSE file for details.
*/

def verbose = 0
try {
verbose = Integer.parseInt(params.VERBOSE ?: '0')
} catch (Exception e) { /* ignored */ }
def verbose = params.VERBOSE ?: '0'

podTemplate(
activeDeadlineSeconds: 21600, // 6h total build limit
Expand All @@ -24,7 +21,7 @@ podTemplate(
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'postgres',
image: "${params.POSTGRES_IMAGE ?: 'postgres:13-alpine'}",
image: params.POSTGRES_IMAGE ?: 'postgres:13-alpine',
runAsUser: '0',
ttyEnabled: true,
resourceRequestCpu: '2',
Expand All @@ -39,19 +36,19 @@ podTemplate(
],
ports: [portMapping(name: 'postgres', containerPort: 5432)]),
containerTemplate(name: 'maven',
image: "${params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11'}",
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: "${params.BUILDER_CPU ?: '4'}",
resourceLimitCpu: "${params.BUILDER_CPU ?: '4'}",
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '8Gi',
resourceLimitMemory: '8Gi') // see also -Xmx flag lower
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: "${params.BRANCH ?: 'master'}",
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("db-init") {
Expand Down
5 changes: 1 addition & 4 deletions tools/jenkins/midpoint-main-generic-sql-server-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
*/

// Our MS SQL Server docs: https://docs.evolveum.com/midpoint/reference/repository/generic/ms-sql/
def verbose = 0
try {
verbose = Integer.parseInt(params.VERBOSE ?: '0')
} catch (Exception e) { /* ignored */ }
def verbose = params.VERBOSE ?: '0'

// ; needs to be escaped with \ for bash below (that is \\ in Groovy string)
def dbprops = '-Dmidpoint.repository.jdbcUrl=jdbc:sqlserver://localhost:1433\\;database=midtest\\;trustServerCertificate=true' +
Expand Down
15 changes: 6 additions & 9 deletions tools/jenkins/midpoint-main-nativepg-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* and European Union Public License. See LICENSE file for details.
*/

def verbose = 0
try {
verbose = Integer.parseInt(params.VERBOSE ?: '0')
} catch (Exception e) { /* ignored */ }
def verbose = params.VERBOSE ?: '0'

podTemplate(
activeDeadlineSeconds: 21600, // 6h total build limit
Expand All @@ -24,7 +21,7 @@ podTemplate(
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'postgres',
image: "${params.POSTGRES_IMAGE ?: 'postgres:13-alpine'}",
image: params.POSTGRES_IMAGE ?: 'postgres:13-alpine',
runAsUser: '0',
ttyEnabled: true,
resourceRequestCpu: '2',
Expand All @@ -39,19 +36,19 @@ podTemplate(
],
ports: [portMapping(name: 'postgres', containerPort: 5432)]),
containerTemplate(name: 'maven',
image: "${params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11'}",
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: "${params.BUILDER_CPU ?: '4'}",
resourceLimitCpu: "${params.BUILDER_CPU ?: '4'}",
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '8Gi',
resourceLimitMemory: '8Gi') // see also -Xmx flag lower
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: "${params.BRANCH ?: 'master'}",
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("db-init") {
Expand Down
13 changes: 5 additions & 8 deletions tools/jenkins/midpoint-main-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* and European Union Public License. See LICENSE file for details.
*/

def verbose = 0
try {
verbose = Integer.parseInt(params.VERBOSE ?: '0')
} catch (Exception e) { /* ignored */ }
def verbose = params.VERBOSE ?: '0'

podTemplate(
activeDeadlineSeconds: 21600, // 6h total build limit
Expand All @@ -25,19 +22,19 @@ podTemplate(
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'maven',
image: "${params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11'}",
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: '4',
resourceLimitCpu: '4',
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '8Gi',
resourceLimitMemory: '8Gi') // see also -Xmx flag lower
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: "${params.BRANCH ?: 'master'}",
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("build") {
Expand Down
13 changes: 5 additions & 8 deletions tools/jenkins/midpoint-quick-pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
* and European Union Public License. See LICENSE file for details.
*/

def verbose = 0
try {
verbose = Integer.parseInt(params.VERBOSE ?: '0')
} catch (Exception e) { /* ignored */ }
def verbose = params.VERBOSE ?: '0'

podTemplate(
activeDeadlineSeconds: 7200,
Expand All @@ -24,19 +21,19 @@ podTemplate(
resourceRequestMemory: '1Gi',
resourceLimitMemory: '1Gi'),
containerTemplate(name: 'maven',
image: "${params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11'}",
image: params.BUILDER_IMAGE ?: 'maven:3.8.5-openjdk-11',
runAsUser: '0',
ttyEnabled: true,
command: 'cat',
resourceRequestCpu: "${params.BUILDER_CPU ?: '4'}",
resourceLimitCpu: "${params.BUILDER_CPU ?: '4'}",
resourceRequestCpu: params.BUILDER_CPU ?: '4',
resourceLimitCpu: params.BUILDER_CPU ?: '4',
resourceRequestMemory: '6Gi',
resourceLimitMemory: '6Gi') // by default -Xmx4g is set in main POM
]
) {
node(POD_LABEL) {
stage("checkout") {
git branch: "${params.BRANCH ?: 'master'}",
git branch: params.BRANCH ?: 'master',
url: 'https://github.com/Evolveum/midpoint.git'
}
stage("build") {
Expand Down

0 comments on commit 16d0bc5

Please sign in to comment.