You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Builds a merge tool in Golang; validates everything works as expected
Instead of using a shell script for managing the merge cli tool, I decided to build a Golang app around it instead for ease of use, updating, management, and testing.
The project is functional and can be used as-is today, including uploading to R2. Ostensibly S3 uploads work too, but I haven't tried.
Copy file name to clipboardExpand all lines: CLAUDE.md
+62-13Lines changed: 62 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,36 +4,85 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This is a Docker-based service that wraps the OneBusAway GTFS Merge CLI tool. It merges multiple GTFS (General Transit Feed Specification) feeds into a single feed and can upload the result to AWS S3.
7
+
This is a Docker-based service that merges multiple GTFS (General Transit Feed Specification) feeds into a single feed and can upload the result to AWS S3. It uses the OneBusAway GTFS Merge CLI tool internally, wrapped in a Go application for better configuration management and error handling.
8
8
9
9
## Key Commands
10
10
11
+
### Build and run locally (for development)
12
+
```bash
13
+
cd merge
14
+
make test-unit # Run unit tests
15
+
make test-integration # Run integration tests (requires JAR)
16
+
go run cmd/gtfs-merge/main.go --config ../example-configs/puget-sound.json
17
+
```
18
+
11
19
### Build the Docker image
12
20
```bash
13
-
docker build --tag oba-merge-service .
21
+
docker build --tag gtfs-merge-service .
14
22
```
15
23
16
24
### Run the container
17
25
```bash
18
-
docker run oba-merge-service
26
+
docker run -e AWS_ACCESS_KEY_ID=xxx -e AWS_SECRET_ACCESS_KEY=yyy \
27
+
-v $(pwd)/config.json:/config.json \
28
+
gtfs-merge-service --config /config.json
19
29
```
20
30
21
31
## Architecture
22
32
23
33
The service consists of:
24
34
25
-
1.**Dockerfile**: Multi-architecture Docker image based on Eclipse Temurin Java 17 JRE that:
26
-
- Downloads the OneBusAway GTFS Merge CLI JAR from Maven Central (version 9.0.1)
27
-
- Installs AWS CLI v2 for S3 uploads (supports both x86_64 and aarch64 architectures)
28
-
- Sets up the merge.sh script as the entrypoint
35
+
1.**Go Application** (`merge/`):
36
+
-`cmd/gtfs-merge/main.go`: Entry point that orchestrates the merge process
37
+
-`internal/config/`: Configuration parsing and validation
0 commit comments