Skip to content

Commit ca2e04d

Browse files
authored
chore(QTDI-740) Remove POST_LOGIN_SCRIPT (#975)
* chore(QTDI-740) Remove POST_LOGIN_SCRIPT https://qlik-dev.atlassian.net/browse/QTDI-740
1 parent 2a9c80f commit ca2e04d

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

Jenkinsfile

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ final String branch_name = pull_request_id != null ? env.CHANGE_BRANCH : env.BRA
6161
// Job config
6262
final Boolean isMasterBranch = branch_name == "master"
6363
final Boolean isStdBranch = (branch_name == "master" || branch_name.startsWith("maintenance/"))
64-
final Boolean hasPostLoginScript = params.POST_LOGIN_SCRIPT != ""
6564
final String extraBuildParams = ""
6665
final String buildTimestamp = String.format('-%tY%<tm%<td%<tH%<tM%<tS', LocalDateTime.now())
6766
final String artifactoryAddr = "https://artifactory.datapwn.com"
@@ -197,10 +196,6 @@ pipeline {
197196
name: 'EXTRA_BUILD_PARAMS',
198197
defaultValue: '',
199198
description: 'Add some extra parameters to maven commands. Applies to all maven calls.')
200-
string(
201-
name: 'POST_LOGIN_SCRIPT',
202-
defaultValue: '',
203-
description: 'Execute a shell command after login. Useful for maintenance.')
204199
booleanParam(
205200
name: 'DISABLE_SONAR',
206201
defaultValue: false,
@@ -381,7 +376,7 @@ pipeline {
381376
// updating build description
382377
String description = """
383378
Version = $finalVersion - $params.Action Build
384-
Disable Sonar: $params.DISABLE_SONAR - Script: $hasPostLoginScript
379+
Disable Sonar: $params.DISABLE_SONAR
385380
Debug: $params.JENKINS_DEBUG
386381
Extra build args: $extraBuildParams """.stripIndent()
387382
jenkinsJobTools.job_description_append(description)
@@ -403,15 +398,17 @@ pipeline {
403398
jiraCredentials,
404399
gpgCredentials]) {
405400
script {
406-
try {
407-
sh """\
408-
#!/usr/bin/env bash
409-
bash "${params.POST_LOGIN_SCRIPT}"
410-
bash .jenkins/scripts/npm_fix.sh
411-
""".stripIndent()
412-
} catch (ignored) {
413-
//
414-
}
401+
sh """\
402+
#!/usr/bin/env bash
403+
bash .jenkins/scripts/npm_fix.sh
404+
""".stripIndent()
405+
406+
// If needed, use jenkins replay function then uncomment this to add your temporary bash command
407+
// This replace the POST_LOGIN_SCRIPT variable used prior to https://qlik-dev.atlassian.net/browse/QTDI-740
408+
// sh """\
409+
// #!/usr/bin/env bash
410+
// bash but anything needed here
411+
// """.stripIndent()
415412
}
416413
}
417414
}
@@ -422,12 +419,12 @@ pipeline {
422419
withCredentials([ossrhCredentials,
423420
nexusCredentials]) {
424421
sh """\
425-
#!/usr/bin/env bash
426-
set -xe
427-
mvn clean install $BUILD_ARGS \
428-
$extraBuildParams \
429-
--settings .jenkins/settings.xml
430-
""".stripIndent()
422+
#!/usr/bin/env bash
423+
set -xe
424+
mvn clean install $BUILD_ARGS \
425+
$extraBuildParams \
426+
--settings .jenkins/settings.xml
427+
""".stripIndent()
431428
}
432429
}
433430
post {
@@ -458,12 +455,12 @@ pipeline {
458455
gpgCredentials,
459456
nexusCredentials]) {
460457
sh """\
461-
#!/usr/bin/env bash
462-
set -xe
463-
bash mvn deploy $deployOptions \
464-
$extraBuildParams \
465-
--settings .jenkins/settings.xml
466-
""".stripIndent()
458+
#!/usr/bin/env bash
459+
set -xe
460+
bash mvn deploy $deployOptions \
461+
$extraBuildParams \
462+
--settings .jenkins/settings.xml
463+
""".stripIndent()
467464
}
468465
}
469466
// Add description to job
@@ -534,10 +531,10 @@ pipeline {
534531

535532
// Build and push specific image
536533
sh """
537-
bash .jenkins/scripts/docker_build.sh \
538-
${finalVersion}${buildTimestamp} \
539-
${images_options}
540-
"""
534+
bash .jenkins/scripts/docker_build.sh \
535+
${finalVersion}${buildTimestamp} \
536+
${images_options}
537+
"""
541538
}
542539

543540
}
@@ -552,15 +549,15 @@ pipeline {
552549
steps {
553550
withCredentials([ossrhCredentials, gitCredentials]) {
554551
sh """\
555-
#!/usr/bin/env bash
556-
set -xe
557-
mvn verify pre-site --file documentation/pom.xml \
558-
--settings .jenkins/settings.xml \
559-
--activate-profiles gh-pages \
560-
--define gpg.skip=true \
561-
$skipOptions \
562-
$extraBuildParams
563-
""".stripIndent()
552+
#!/usr/bin/env bash
553+
set -xe
554+
mvn verify pre-site --file documentation/pom.xml \
555+
--settings .jenkins/settings.xml \
556+
--activate-profiles gh-pages \
557+
--define gpg.skip=true \
558+
$skipOptions \
559+
$extraBuildParams
560+
""".stripIndent()
564561
}
565562
}
566563
}
@@ -575,8 +572,8 @@ pipeline {
575572
withCredentials([ossrhCredentials]) {
576573
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
577574
sh """
578-
bash .jenkins/scripts/mvn-ossindex-audit.sh
579-
"""
575+
bash .jenkins/scripts/mvn-ossindex-audit.sh
576+
"""
580577
}
581578
}
582579
}

0 commit comments

Comments
 (0)