Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Add Prep functions build function #309

Merged
merged 1 commit into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pipeline {

stage("Push Squash Images") {
when {
anyOf { buildingTag()}
anyOf { buildingTag() }
}
steps {
script {
Expand Down
40 changes: 34 additions & 6 deletions run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ install_dependencies() {
exit 1
fi
fi

# zip-it-and-ship-it
if [ -n "$ZISI_VERSION" ]
then
Expand Down Expand Up @@ -684,6 +684,39 @@ set_go_import_path() {
fi
}

prep_functions() {
local functionsDir=$1
local zisiTempDir=$2

if [[ -z "$functionsDir" ]]; then
echo "Skipping functions preparation step: no functions directory set"
return 0
else
echo Function Dir: $functionsDir
fi

if [[ ! -d "$functionsDir" ]]; then
echo "Skipping functions preparation step: $functionsDir not found"
return 0
fi

if [[ -z "$zisiTempDir" ]]; then
echo "Skipping functions preparation step: no temp directory set"
else
echo TempDir: $zisiTempDir
fi
# ZISI will create this foler if it doesn't exist, we don't need to check for it

echo Prepping functions with zip-it-and-ship-it $(zip-it-and-ship-it --version)

if zip-it-and-ship-it $functionsDir $zisiTempDir; then
echo "Prepping functions complete"
else
echo "Error prepping functions"
exit 1
fi
}

find_running_procs() {
ps aux | grep -v [p]s | grep -v [g]rep | grep -v [b]ash | grep -v "/usr/local/bin/buildbot" | grep -v [d]efunct | grep -v "[build]"
}
Expand All @@ -704,8 +737,3 @@ report_lingering_procs() {
echo -e "${NC}"
fi
}

after_build_steps() {
bcomnes marked this conversation as resolved.
Show resolved Hide resolved
# Find lingering processes after the build finished and report it to the user
report_lingering_procs
bcomnes marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 0 additions & 2 deletions run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ echo "Executing user command: $cmd"
eval "$cmd"
CODE=$?

after_build_steps

exit $CODE