Skip to content

Commit

Permalink
Update to step in minor version reference
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenSpicknall committed Aug 16, 2023
1 parent 10c9632 commit 20f9f9e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 7 additions & 3 deletions jobs/gtfs-schedule-validator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ COPY ./gtfs-validator-v2.0.0_cli.jar ${V2_VALIDATOR_JAR}
ENV V3_VALIDATOR_JAR=/gtfs-validator-3.1.1-cli.jar
COPY ./gtfs-validator-3.1.1-cli.jar ${V3_VALIDATOR_JAR}

# v4 from https://github.com/MobilityData/gtfs-validator/releases/download/v4.1.0/gtfs-validator-4.1.0-cli.jar
ENV V4_VALIDATOR_JAR=/gtfs-validator-4.1.0-cli.jar
COPY ./gtfs-validator-4.1.0-cli.jar ${V4_VALIDATOR_JAR}
# v4 from https://github.com/MobilityData/gtfs-validator/releases/download/v4.0.0/gtfs-validator-4.0.0-cli.jar
ENV V4_VALIDATOR_JAR=/gtfs-validator-4.0.0-cli.jar
COPY ./gtfs-validator-4.0.0-cli.jar ${V4_VALIDATOR_JAR}

# v4.1.0 from https://github.com/MobilityData/gtfs-validator/releases/download/v4.1.0/gtfs-validator-4.1.0-cli.jar
ENV V4_1_VALIDATOR_JAR=/gtfs-validator-4.1.0-cli.jar
COPY ./gtfs-validator-4.1.0-cli.jar ${V4_1_VALIDATOR_JAR}

WORKDIR /app

Expand Down
6 changes: 5 additions & 1 deletion jobs/gtfs-schedule-validator/gtfs_schedule_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
V2_VALIDATOR_JAR = os.getenv("V2_VALIDATOR_JAR")
V3_VALIDATOR_JAR = os.getenv("V3_VALIDATOR_JAR")
V4_VALIDATOR_JAR = os.getenv("V4_VALIDATOR_JAR")
V4_1_VALIDATOR_JAR = os.getenv("V4_1_VALIDATOR_JAR")

JAR_DEFAULT = typer.Option(
default=os.environ.get(SCHEDULE_VALIDATOR_JAR_LOCATION_ENV_KEY),
Expand Down Expand Up @@ -146,8 +147,11 @@ def execute_schedule_validator(
elif extract_ts.date() < pendulum.Date(2022, 11, 16):
versioned_jar_path = V3_VALIDATOR_JAR
validator_version = "v3.1.1"
else:
elif extract_ts.date() < pendulum.Date(2023, 9, 1):
versioned_jar_path = V4_VALIDATOR_JAR
validator_version = "v4.0.0"
else:
versioned_jar_path = V4_1_VALIDATOR_JAR
validator_version = "v4.1.0"

assert versioned_jar_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
V2_VALIDATOR_JAR = os.getenv("V2_VALIDATOR_JAR")
V3_VALIDATOR_JAR = os.getenv("V3_VALIDATOR_JAR")
V4_VALIDATOR_JAR = os.getenv("V4_VALIDATOR_JAR")
V4_1_VALIDATOR_JAR = os.getenv("V4_1_VALIDATOR_JAR")

JAR_DEFAULT = typer.Option(
default=os.environ.get(SCHEDULE_VALIDATOR_JAR_LOCATION_ENV_KEY),
Expand Down Expand Up @@ -153,8 +154,11 @@ def execute_schedule_validator(
elif extract_ts.date() < pendulum.Date(2022, 11, 16):
versioned_jar_path = V3_VALIDATOR_JAR
validator_version = "v3.1.1"
else:
elif extract_ts.date() < pendulum.Date(2023, 9, 1):
versioned_jar_path = V4_VALIDATOR_JAR
validator_version = "v4.0.0"
else:
versioned_jar_path = V4_1_VALIDATOR_JAR
validator_version = "v4.1.0"

assert versioned_jar_path
Expand Down

0 comments on commit 20f9f9e

Please sign in to comment.