-
Notifications
You must be signed in to change notification settings - Fork 322
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
Dockerize #181
Dockerize #181
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM ruby:2.4.2-jessie | ||
|
||
# Clone sendgrid-ruby | ||
WORKDIR /sources | ||
RUN git clone https://github.com/sendgrid/sendgrid-ruby.git | ||
|
||
# Bundle | ||
WORKDIR /sources/sendgrid-ruby | ||
RUN bundle install | ||
|
||
# Install prism | ||
RUN curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh | sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Docker image for sendgrid-ruby | ||
|
||
## Quickstart | ||
1. [Install Docker](https://docs.docker.com/engine/installation/) on your machine. | ||
2. Run `docker run --rm -it sendgrid/sendgrid-ruby irb`. | ||
3. Run `require './lib/sendgrid-ruby.rb'`. | ||
|
||
## Poke around | ||
|
||
If you would like to just poke around in the image and check some examples: | ||
```sh | ||
docker run --rm -it sendgrid/sendgrid-ruby bash | ||
``` | ||
|
||
If you want to mount your fork or specific version of the gem: | ||
```sh | ||
docker run --rm -v /path/to/local/sendgrid-ruby:/sources/sendgrid-ruby -it sendgrid/sendgrid-ruby bash | ||
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. Would you be up for adding a docker-compose file that would make the ruby gems and source code local to the machine the container is running on? 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. Will the volumes not be sufficient for this? |
||
``` | ||
|
||
## Running tests | ||
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. This is awesome. thank you!! |
||
|
||
If you would like to run the tests present in the image: | ||
```sh | ||
docker run --rm sendgrid/sendgrid-ruby rake | ||
``` | ||
|
||
If you want to run tests on your fork or a specific version, mount the codebase onto the image: | ||
```sh | ||
docker run --rm -v /path/to/local/sendgrid-ruby:/sources/sendgrid-ruby sendgrid/sendgrid-ruby rake | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the
irb
at the end there?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to get a interpretor where a dev could try out the gem without having to run it.