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

allows loading a local csv file #176

Merged
merged 5 commits into from
Jul 7, 2022
Merged

Conversation

dcasati
Copy link
Contributor

@dcasati dcasati commented Apr 5, 2021

On this PR -

  • allows for mounting a volume on the host machine and loading that CSV file into the Radar - added a sample csv file for tests. This is located under /opt/bring-your-own-radar/sheets/radar.csv
  • flex CORS restrictions on the local NGINX to be able to serve the CSV files from the same location.
  • modified the Dockerfile to reflect these changes.

This should address common scenarios as described on #163 , #159, #133

For a quick test while an official docker image isn't in place:

$ docker pull  dcasati/build-your-own-radar
$ docker run --rm -p 8080:80 -e SERVER_NAMES="localhost 127.0.0.1" -v /mnt/radar/sheets/:/opt/build-your-own-radar/sheets dcasati/build-your-own-radar
$ open http://localhost:8080

This will:

  1. spawn a server that will listen locally on port 8080
  2. mount the host volume on /mnt/radar/sheets/ into the container on /opt/build-your-own-radar/sheets/.
  3. open http://localhost:8080 and for the URL piece '(Enter the URL of your Google Sheet of CSV file bellow...)' type: http://localhost:8080/sheets/${NAME_OF_YOUR_SHEET}.csv - it needs to be a csv file.

You can now work locally on your machine, updating the csv file, rendering the result back on your browser.

dcasati and others added 3 commits April 5, 2021 16:00
- modify the Dockerfile to reflect the new configuration
- add a sheets directory with a sample sheet from the radar (based on
the fix from
thoughtworks#151)
@derrabauke
Copy link

Very nice PR! Helped me a lot to get the project started locally and not wasting time to setup local file upload.

Keep in mind to change the volume mount path according to your setup. I put in directly into the src directory. ($pwd for windows)

$ ... -v $pwd/src/sheets/:/opt/build-your-own-radar/sheets ...

@lfguerreiro
Copy link

very good! It will help a lot. @dcasati

@lulubobst
Copy link

lulubobst commented Nov 22, 2021

Hi @dcasati whenI used this url in chrome, it use to just dl's the .csv and didnt render any JS. Now it renders just the csv no radar. Any tips? I used /tmp/sheets instead of your /mnt/radar/sheets/

docker run --rm -p 8080:80 -e SERVER_NAMES="localhost 127.0.0.1" -v /tmp/sheets/:/opt/build-your-own-radar/sheets --platform linux/amd64 docker.io/dcasati/bring-your-own-radar

http://localhost:8080/sheets/sheet.csv just renders the csv in the browser, no radar is displayed. Any tips?

@send2r
Copy link

send2r commented Mar 7, 2022

Hi @dcasati whenI used this url in chrome, it use to just dl's the .csv and didnt render any JS. Now it renders just the csv no radar. Any tips? I used /tmp/sheets instead of your /mnt/radar/sheets/

docker run --rm -p 8080:80 -e SERVER_NAMES="localhost 127.0.0.1" -v /tmp/sheets/:/opt/build-your-own-radar/sheets --platform linux/amd64 docker.io/dcasati/bring-your-own-radar

http://localhost:8080/sheets/sheet.csv just renders the csv in the browser, no radar is displayed. Any tips?

@lulubobst Not sure if you figured it out. However, just for posterity. You should not put the URL in your browser address bar. Instead http://localhost:8080/sheets/sheet.csv needs to be put in the "Enter the URL of your Google Sheet or CSV file below…" text box. After this, upon clicking "Build my radar" generates the radar without any errors. @dcasati Thanks a lot. Best fork out there for this repo!

@rogierlommers
Copy link

Hey @dcasati , this is still open to merge? Any idea why your changes hasn't been merged yet?

@Madhumitha2911
Copy link
Contributor

Hi @dcasati ,
We have made docker image related changes in master branch. Kindly resolve the conflicts and raise a pull request again.

@sarnya sarnya merged commit 67edb67 into thoughtworks:master Jul 7, 2022
@sarnya
Copy link
Contributor

sarnya commented Jul 7, 2022

The merge conflicts were resolved and the PR was merged

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.

None yet

8 participants