Debian Codegraph @

tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh

raw
1 #!/usr/bin/env bash
2 # Copyright 2021 The gRPC Authors
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 # If you have used "move_src_tree_and_respawn_itself_rc" in a CI script
17 # and the script produces artifacts to be stored by kokoro, run this
18 # at the end of the script.
19
20 set -ex
21
22 if [ "${GRPC_TEST_REPORT_BASE_DIR}" == "" ]
23 then
24 # looks like the move_src_tree_and_respawn_itself_rc hasn't been used
25 # and we're not running under a moved source tree
26 exit 0
27 fi
28
29 # change to grpc repo root
30 cd "$(dirname "$0")/../../.."
31
32 # If running under a moved source tree (see grpc/tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc),
33 # we need to copy the artifacts produced by the build to a location that's stored by kokoro.
34
35 # artifacts in this directory will be stored by kokoro
36 mkdir -p "${GRPC_TEST_REPORT_BASE_DIR}/artifacts"
37 time cp -r artifacts/* "${GRPC_TEST_REPORT_BASE_DIR}/artifacts" || true