-
Notifications
You must be signed in to change notification settings - Fork 1
Automate GTFS validator version updates via Dependabot-managed Maven pin #764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
e48b204
73e9212
a856fcd
8fef189
cf80bca
75da1bc
f80cdaa
eb7bbcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,9 +27,48 @@ fi | |||||||||||||||||||||||||||||||
| # gh release list --limit 1 --repo github.com/MobilityData/gtfs-validator; | ||||||||||||||||||||||||||||||||
| # echo "> GTFS Validator latest release... DONE"; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| JAR_FILE_PATTERN="$SCRIPT_DIR/gtfs-validator-*.jar"; | ||||||||||||||||||||||||||||||||
| JAR_FILES=($JAR_FILE_PATTERN); | ||||||||||||||||||||||||||||||||
| JAR_FILE="${JAR_FILES[0]}"; | ||||||||||||||||||||||||||||||||
| VERSION_FILE="$SCRIPT_DIR/pom.xml"; | ||||||||||||||||||||||||||||||||
| if [ ! -f "$VERSION_FILE" ]; then | ||||||||||||||||||||||||||||||||
| echo "> GTFS Validator version file '$VERSION_FILE' not found!"; | ||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| if ! command -v mvn >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||
| echo "> Maven CLI is required to resolve GTFS Validator version!"; | ||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| GTFS_VALIDATOR_VERSION=$(mvn -q -f "$VERSION_FILE" help:evaluate -Dexpression=gtfs.validator.version -DforceStdout); | ||||||||||||||||||||||||||||||||
| MVN_RESULT=$?; | ||||||||||||||||||||||||||||||||
| if [[ ${MVN_RESULT} -ne 0 ]]; then | ||||||||||||||||||||||||||||||||
| echo "> Error while resolving GTFS Validator version from '$VERSION_FILE'!"; | ||||||||||||||||||||||||||||||||
| exit ${MVN_RESULT}; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| if [ -z "$GTFS_VALIDATOR_VERSION" ]; then | ||||||||||||||||||||||||||||||||
| echo "> GTFS Validator version not found in '$VERSION_FILE'!"; | ||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| JAR_FILE="$SCRIPT_DIR/gtfs-validator-$GTFS_VALIDATOR_VERSION-cli.jar"; | ||||||||||||||||||||||||||||||||
| if [ ! -f "$JAR_FILE" ]; then | ||||||||||||||||||||||||||||||||
|
mmathieum marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||
| if ! command -v gh >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||
| echo "> GitHub CLI (gh) is required to download GTFS Validator '$GTFS_VALIDATOR_VERSION' (https://cli.github.com/)!"; | ||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| echo "> Downloading GTFS Validator '$GTFS_VALIDATOR_VERSION'..."; | ||||||||||||||||||||||||||||||||
| gh release download "v$GTFS_VALIDATOR_VERSION" \ | ||||||||||||||||||||||||||||||||
| --repo MobilityData/gtfs-validator \ | ||||||||||||||||||||||||||||||||
| --pattern "gtfs-validator-$GTFS_VALIDATOR_VERSION-cli.jar" \ | ||||||||||||||||||||||||||||||||
| --dir "$SCRIPT_DIR"; | ||||||||||||||||||||||||||||||||
|
Comment on lines
+43
to
+51
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||||||||||||||||||||||||
| DOWNLOAD_RESULT=$?; | ||||||||||||||||||||||||||||||||
| if [[ ${DOWNLOAD_RESULT} -ne 0 ]]; then | ||||||||||||||||||||||||||||||||
| echo "> Error while downloading GTFS Validator '$GTFS_VALIDATOR_VERSION'!"; | ||||||||||||||||||||||||||||||||
| exit ${DOWNLOAD_RESULT}; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| if [ ! -s "$JAR_FILE" ]; then | ||||||||||||||||||||||||||||||||
| echo "> Downloaded GTFS Validator JAR '$JAR_FILE' is missing or empty!"; | ||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| echo "> Downloading GTFS Validator '$GTFS_VALIDATOR_VERSION'... DONE"; | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
mmathieum marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||
| echo "> GTFS Validator version: '$GTFS_VALIDATOR_VERSION'."; | ||||||||||||||||||||||||||||||||
| echo "> GTFS Validator JAR file: '$JAR_FILE'."; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| echo "> Launching GTFS Validator..."; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
mmathieum marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
|
|
||
| <groupId>org.mtransitapps.commons</groupId> | ||
| <artifactId>gtfs-validator-version</artifactId> | ||
| <version>1.0.0</version> | ||
|
|
||
| <properties> | ||
| <gtfs.validator.version>8.0.1</gtfs.validator.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.mobilitydata.gtfs-validator</groupId> | ||
| <artifactId>gtfs-validator-main</artifactId> | ||
| <version>${gtfs.validator.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
| </project> |
Uh oh!
There was an error while loading. Please reload this page.