Skip to content

Commit 2dd304d

Browse files
authored
fix periodic builds (#294)
1 parent 84bd7d9 commit 2dd304d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

periodic_builds/build_all_repos.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
# limitations under the License.
1515

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

1826
# Returns the first folder in a path-like string that doesn't start with /
1927
#
@@ -116,6 +124,14 @@ function main {
116124
cloudbuild_path=$(echo "$cloudbuild_config" | cut -d' ' -f1)
117125
clone_dc $(get_root_folder_of_path_like $cloudbuild_path)
118126
done < "$BUILDS_FILE"
127+
128+
for file_line in ${FILE_LINES_TO_REMOVE[@]}; do
129+
file_path=$(echo $file_line | cut -d';' -f1)
130+
line_pattern=$(echo $file_line | cut -d';' -f2)
131+
if [ -f $file_path ]; then
132+
sed -i $line_pattern $file_path
133+
fi
134+
done
119135

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

0 commit comments

Comments
 (0)