-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathcheck_non_release_please_versions.sh
More file actions
executable file
·43 lines (38 loc) · 1.35 KB
/
check_non_release_please_versions.sh
File metadata and controls
executable file
·43 lines (38 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -e
violations=0
for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
if [[ "${pomFile}" =~ .*google-cloud-jar-parent.* ]] || \
[[ "${pomFile}" =~ .*google-cloud-pom-parent.* ]] || \
[[ "${pomFile}" =~ .*CoverageAggregator.* ]] || \
[[ "${pomFile}" =~ .*java-shared-dependencies*. ]] || \
[[ "${pomFile}" =~ .*java-bigquerystorage.* ]] || \
[[ "${pomFile}" =~ .*java-datastore.* ]] || \
[[ "${pomFile}" =~ .*java-logging-logback.* ]] || \
[[ "${pomFile}" =~ .*java-bigquery.* ]] || \
[[ "${pomFile}" =~ .*java-storage.* ]] || \
[[ "${pomFile}" =~ .*.github*. ]]; then
continue
fi
if [[ "${pomFile}" =~ .*owl-bot-postprocessor.* ]]; then
# Skip the template files
continue
fi
if [[ "${pomFile}" =~ .*java-samples.* ]]; then
echo "Skipping version check for java-samples directory"
continue
fi
if [[ "${pomFile}" =~ .*/samples/.* ]]; then
echo "Skipping version check for samples directory"
continue
fi
if grep -n '<version>.*</version>' "$pomFile" | grep -v 'x-version-update'; then
echo "Found version declaration(s) without x-version-update in: $pomFile"
violations=$((violations + 1))
echo "---------------------------------------------------------"
fi
done
echo "FOUND $violations VIOLATIONS!"
if [[ $violations -gt 0 ]]; then
exit 1
fi