Skip to content

Commit

Permalink
Add instructions to README
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jun 22, 2020
1 parent 7e45a4c commit 3c1338b
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[![Build Status](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3.svg?branch=master)](https://travis-ci.com/AlchemyCMS/alchemy-dragonfly-s3)

# AlchemyCMS AWS S3

Provides a `Alchemy::Picture.url_class` and `Alchemy::PictureThumb.generator_class` for Alchemy pictures stored on Amazon AWS S3.

## Installation

Add this line to your application's Gemfile:
Expand All @@ -8,10 +12,48 @@ Add this line to your application's Gemfile:
gem 'alchemy-dragonfly-s3', github: 'AlchemyCMS/alchemy-dragonfly-s3'
```

For now you also need a special AlchemyCMS branch

```ruby
gem 'alchemy_cms', github: 'tvdeyen/alchemy_cms', branch: 'remote-images'
```

And then execute:

```
$ bundle
$ bundle install
```

Install the picture thumbs migration from Alchemy 5.1

```
$ bin/rake alchemy:install:migrations
$ bin/rake db:migrate
```

## Setup

Configure a S3 datastore for Dragonfly

```ruby
# config/initializers/dragonfly

require "dragonfly/s3_data_store"

...

Dragonfly.app(:alchemy_pictures).configure do
plugin :imagemagick
plugin :svg

datastore :s3,
bucket_name: ENV.fetch("ALCHEMY_S3_BUCKET_NAME"),
access_key_id: ENV.fetch("ALCHEMY_S3_ACCESS_KEY_ID"),
secret_access_key: ENV.fetch("ALCHEMY_S3_SECRET_ACCESS_KEY"),
region: ENV.fetch("ALCHEMY_S3_REGION")
end

...
```

## License
Expand Down

0 comments on commit 3c1338b

Please sign in to comment.