Skip to content
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

feat: allow build bundle inside oba_app #78

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

Altonhe
Copy link
Member

@Altonhe Altonhe commented Apr 23, 2024

Allow to build bundle inside oba_app, you can try with:

  oba_app:
    container_name: oba_app
    depends_on:
      - oba_database
    build:
      context: ./oba
    environment:
      - JDBC_URL=jdbc:mysql://oba_database:3306/oba_database
      - JDBC_USER=oba_user
      - JDBC_PASSWORD=oba_password
      - TEST_API_KEY=test # For test only, remove in production
      - GTFS_URL=https://unitrans.ucdavis.edu/media/gtfs/Unitrans_GTFS.zip
      - 
    ports:
      # Access the webapp on your host machine at a path like
      # http://localhost:8080/onebusaway-api-webapp/api/where/agency/${YOUR_AGENCY}.json?key=TEST
      - "8080:8080"
    # restart: always

Result:
image

(base) ➜  bin git:(feature/bundle-builder) ✗ ./validate.sh
current-time.json endpoint works.
agencies-with-coverage.json endpoint works.
routes-for-agency/unitrans.json endpoint works.
stops-for-route/unitrans_C.json endpoint works.
stop/unitrans_22182.json endpoint works.

@@ -67,6 +67,8 @@ You can find the latest published Docker images on Docker Hub:
* `JDBC_URL` - The JDBC connection URL for your MySQL database.
* `JDBC_USER` - The username for your MySQL database.
* `JDBC_PASSWORD` - The password for your MySQL database.
* GTFS (Optional, required only when using `oba_app` independently)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@Altonhe Altonhe marked this pull request as ready for review April 23, 2024 16:00
@@ -5,6 +5,21 @@ NAMESPACE_PREFIX="x"
NAMESPACE_URI="http://www.springframework.org/schema/beans"
BEAN_ID="testAPIKey"

# Build bundle inside the container
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a priority right now, but I noticed that the oba_app docker container has perl 5 installed in it. How would you feel about rewriting the bash script in perl to make it more DRY, and easier to manage and extend?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think would be a good idea to avoid overcomplicating our bootstrap.sh script, while I haven't learned Perl, I am willing to learn and apply it to the processes.

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great 👍

@aaronbrethorst aaronbrethorst merged commit 18d2714 into OneBusAway:main Apr 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants