From 01347ac4af3b97ca8c4efb156a71e194f7acba12 Mon Sep 17 00:00:00 2001 From: John Blum Date: Mon, 5 Apr 2021 14:09:08 -0700 Subject: [PATCH] Separate Jenkins CI build Pipeline Steps into individual Bash shell scripts. --- ci/check.sh | 8 ++++++++ ci/cleanupArtifacts.sh | 6 ++++++ ci/cleanupGemFiles.sh | 10 ++++++++++ ci/deployArtifacts.sh | 6 ++++++ ci/deployDocs.sh | 6 ++++++ 5 files changed, 36 insertions(+) create mode 100755 ci/check.sh create mode 100755 ci/cleanupArtifacts.sh create mode 100755 ci/cleanupGemFiles.sh create mode 100755 ci/deployArtifacts.sh create mode 100755 ci/deployDocs.sh diff --git a/ci/check.sh b/ci/check.sh new file mode 100755 index 00000000..0873380f --- /dev/null +++ b/ci/check.sh @@ -0,0 +1,8 @@ +#!/bin/bash -x + +set -eou pipefail +mkdir -p /tmp/jenkins-home +chown -R 1001:1001 . + +GRADLE_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \ + ./gradlew --no-daemon --refresh-dependencies --stacktrace clean check diff --git a/ci/cleanupArtifacts.sh b/ci/cleanupArtifacts.sh new file mode 100755 index 00000000..e6393301 --- /dev/null +++ b/ci/cleanupArtifacts.sh @@ -0,0 +1,6 @@ +#!/bin/bash -x + +set -eou pipefail +chown -R 1001:1001 . +rm -Rf ./.gradle +rm -Rf ./.m2 diff --git a/ci/cleanupGemFiles.sh b/ci/cleanupGemFiles.sh new file mode 100755 index 00000000..0e211994 --- /dev/null +++ b/ci/cleanupGemFiles.sh @@ -0,0 +1,10 @@ +#!/bin/bash -x + +set -eou pipefail +chown -R 1001:1001 . +rm -Rf `find . -name "BACKUPDEFAULT*"` +rm -Rf `find . -name "ConfigDiskDir*"` +rm -Rf `find . -name "locator*" | grep -v "src" | grep -v "locator-application"` +rm -Rf `find . -name "newDB"` +rm -Rf `find . -name "server" | grep -v "src"` +rm -Rf `find . -name "*.log"` diff --git a/ci/deployArtifacts.sh b/ci/deployArtifacts.sh new file mode 100755 index 00000000..bb6f8622 --- /dev/null +++ b/ci/deployArtifacts.sh @@ -0,0 +1,6 @@ +#!/bin/bash -x + +set -eou pipefail + +GRADLE_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \ + ./gradlew deployArtifacts finalizeDeployArtifacts --no-daemon --refresh-dependencies --stacktrace -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD diff --git a/ci/deployDocs.sh b/ci/deployDocs.sh new file mode 100755 index 00000000..3ca95166 --- /dev/null +++ b/ci/deployDocs.sh @@ -0,0 +1,6 @@ +#!/bin/bash -x + +set -eou pipefail + +GRADLE_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" \ + ./gradlew --no-daemon --refresh-dependencies --stacktrace -PdeployDocsSshKeyPath=$DEPLOY_SSH_KEY -PdeployDocsSshUsername=$SPRING_DOCS_USERNAME deployDocs