Skip to content

Commit

Permalink
compress all build artifacts after e2e tests
Browse files Browse the repository at this point in the history
On-behalf-of: @SAP [email protected]
  • Loading branch information
xrstf committed Feb 21, 2025
1 parent 7d0b5b2 commit 2c79e44
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .prow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ presubmits:
containers:
- image: ghcr.io/kcp-dev/infra/build:1.22.10-1
command:
- ./hack/run-with-artifacts.sh
- ./hack/run-with-prometheus.sh
- make
- test-e2e
Expand Down
35 changes: 35 additions & 0 deletions hack/run-with-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

# Copyright 2023 The KCP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o nounset
set -o pipefail
set -o errexit

set -o xtrace
set +o errexit
"${@}"
EXIT_CODE=${?}
set +o xtrace
set -o errexit
echo "Command terminated with ${EXIT_CODE}"

if [ -n "${ARTIFACT_DIR:=}" ]; then
echo 'Compressing build artifacts...'
cd "$ARTIFACT_DIR"
tar cvzf artifacts.tar.gz --remove-files *
fi

exit "${EXIT_CODE}"

0 comments on commit 2c79e44

Please sign in to comment.