Use Bash shell scripts to encapsulate build steps in the Jenkins CI build stages.

This commit is contained in:
John Blum
2021-04-14 14:28:01 -07:00
parent a948bdb985
commit 4dcdbe4e7d
6 changed files with 69 additions and 0 deletions

6
ci/check.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash -x
set -eou pipefail
GRADLE_OPTS="-Duser.name=jenkins -Djava.io.tmpdir=/tmp -Dgradle.user.home=/tmp/geode/session/build-gradle-cache" \
./gradlew clean check --no-daemon --refresh-dependencies --stacktrace

5
ci/cleanupArtifacts.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash -x
rm -Rf ./.gradle
rm -Rf ./.m2
exit 0

9
ci/cleanupGemFiles.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash -x
rm -Rf `find . -name "BACKUPDEFAULT*"`
rm -Rf `find . -name "ConfigDiskDir*"`
rm -Rf `find . -name "locator*" | grep -v "src"
rm -Rf `find . -name "newDB"`
rm -Rf `find . -name "server" | grep -v "src"`
rm -Rf `find . -name "*.log"`
exit 0

20
ci/deployArtifacts.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash -x
set -eou pipefail
echo "Deploying artifacts on host [$HOSTNAME]"
# User ID 1001 is "jenkins"
# Group ID 1001 is "jenkins"
# Syntax: `chown -R userId:groupId .`
chown -R 1001:1001 .
GRADLE_OPTS="-Duser.name=jenkins -Djava.io.tmpdir=/tmp -Dgradle.user.home=/tmp/geode/session/artifacts-gradle-cache" \
./gradlew deployArtifacts finalizeDeployArtifacts --no-build-cache --no-configuration-cache --no-daemon --stacktrace \
-PartifactoryUsername=$ARTIFACTORY_USERNAME \
-PartifactoryPassword=$ARTIFACTORY_PASSWORD \
-PossrhUsername=$OSSRH_USERNAME \
-PossrhPassword=$OSSRH_PASSWORD \
-Psigning.keyId=$SPRING_SIGNING_KEYID \
-Psigning.password=$SIGNING_PASSWORD \
-Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE

15
ci/deployDocs.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash -x
set -eou pipefail
echo "Deploying docs on host [$HOSTNAME]"
# User ID 1001 is "jenkins"
# Group ID 1001 is "jenkins"
# Syntax: `chown -R userId:groupId .`
chown -R 1001:1001 .
GRADLE_OPTS="-Duser.name=jenkins -Djava.io.tmpdir=/tmp -Dgradle.user.home=/tmp/geode/session/docs-gradle-cache" \
./gradlew deployDocs --no-daemon --stacktrace \
-PdeployDocsSshKeyPath=$DEPLOY_SSH_KEY \
-PdeployDocsSshUsername=$SPRING_DOCS_USERNAME

14
ci/setup.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash -x
# User ID 1001 is "jenkins"
# Group ID 1001 is "jenkins"
# Syntax: `chown -R userId:groupId .`
echo "Logged in as user [$USER] with home directory [$HOME] in the current working directory [$PWD]"
chown -R 1001:1001 .
mkdir -p /tmp/geode/session/artifacts-gradle-cache
mkdir -p /tmp/geode/session/build-gradle-cache
mkdir -p /tmp/geode/session/docs-gradle-cache
echo "Logging into Docker..."
docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}
exit 0