mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[CI] Ensure checkout is cleaned up in packer cache script (#87762)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
f12228e635
commit
c2a556bb70
1 changed files with 11 additions and 3 deletions
|
@ -5,6 +5,17 @@ set -e
|
|||
branch="$1"
|
||||
checkoutDir="$(pwd)"
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
if [[ "$branch" != "master" ]]; then
|
||||
rm --preserve-root -rf "$checkoutDir"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap 'cleanup' 0
|
||||
|
||||
if [[ "$branch" != "master" ]]; then
|
||||
checkoutDir="/tmp/kibana-$branch"
|
||||
git clone https://github.com/elastic/kibana.git --branch "$branch" --depth 1 "$checkoutDir"
|
||||
|
@ -56,6 +67,3 @@ echo "created $HOME/.kibana/bootstrap_cache/$branch.tar"
|
|||
|
||||
.ci/build_docker.sh
|
||||
|
||||
if [[ "$branch" != "master" ]]; then
|
||||
rm --preserve-root -rf "$checkoutDir"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue