Skip to content

Commit

Permalink
fix periodic builds (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
chejennifer authored Dec 11, 2024
1 parent 84bd7d9 commit 2dd304d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions periodic_builds/build_all_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
# limitations under the License.

BUILDS_FILE="$PWD/builds.txt"
# Repositories have .*ignore files that can cause periodic builds to fail if
# data files used for tests are included. This is because for periodic builds,
# cloudbuild uploads the source files to GCS then runs the tests against the
# uploaded source files. In other cases of running the same tests, the tests are
# run directly against the repository.
# This is a list of strings of the format <file>;<line pattern> where the
# line pattern needs to be removed from the file for periodic builds.
FILE_LINES_TO_REMOVE=("./website/.dockerignore;/test_data/d" "./website/.dockerignore;/testdata/d" "./data/.gitignore;/data/d")

# Returns the first folder in a path-like string that doesn't start with /
#
Expand Down Expand Up @@ -116,6 +124,14 @@ function main {
cloudbuild_path=$(echo "$cloudbuild_config" | cut -d' ' -f1)
clone_dc $(get_root_folder_of_path_like $cloudbuild_path)
done < "$BUILDS_FILE"

for file_line in ${FILE_LINES_TO_REMOVE[@]}; do
file_path=$(echo $file_line | cut -d';' -f1)
line_pattern=$(echo $file_line | cut -d';' -f2)
if [ -f $file_path ]; then
sed -i $line_pattern $file_path
fi
done

# Launch the build jobs in parallel, accumulating process IDs
# in $pids. reference: https://stackoverflow.com/a/26240420
Expand Down

0 comments on commit 2dd304d

Please sign in to comment.