Skip to content
This repository was archived by the owner on Nov 6, 2021. It is now read-only.

Commit 31ce8f3

Browse files
authored
Update partnerbase to utilize Azure Storage instead of keeping files in the VM storage (#553)
* Set it up to use AzureStorage * Fix migrations timestamps
1 parent 8844992 commit 31ce8f3

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
33

44
ruby "2.7.2"
55

6+
gem 'azure-storage', '~> 0.15.0.preview', require: false
67
gem "bootsnap", ">= 1.1.0", require: false
78
gem "bootstrap", "~> 4.5.3"
89
gem "bugsnag"

Gemfile.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ GEM
6666
ast (2.4.1)
6767
autoprefixer-rails (10.0.1.3)
6868
execjs
69+
azure-core (0.1.15)
70+
faraday (~> 0.9)
71+
faraday_middleware (~> 0.10)
72+
nokogiri (~> 1.6)
73+
azure-storage (0.15.0.preview)
74+
azure-core (~> 0.1)
75+
faraday (~> 0.9)
76+
faraday_middleware (~> 0.10)
77+
nokogiri (~> 1.6, >= 1.6.8)
6978
bcrypt (3.1.16)
7079
better_errors (2.9.1)
7180
coderay (>= 1.0.0)
@@ -167,6 +176,10 @@ GEM
167176
railties (>= 5.0.0)
168177
faker (2.15.1)
169178
i18n (>= 1.6, < 2)
179+
faraday (0.17.4)
180+
multipart-post (>= 1.2, < 3)
181+
faraday_middleware (0.14.0)
182+
faraday (>= 0.7.4, < 1.0)
170183
ffi (1.14.2)
171184
filterrific (5.2.1)
172185
flipper (0.20.3)
@@ -246,6 +259,7 @@ GEM
246259
libv8 (~> 8.4.255)
247260
minitest (5.14.3)
248261
msgpack (1.4.2)
262+
multipart-post (2.1.1)
249263
nenv (0.3.0)
250264
net-scp (3.0.0)
251265
net-ssh (>= 2.6.5, < 7.0.0)
@@ -455,6 +469,7 @@ PLATFORMS
455469

456470
DEPENDENCIES
457471
annotate
472+
azure-storage (~> 0.15.0.preview)
458473
better_errors
459474
binding_of_caller
460475
bootsnap (>= 1.1.0)

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
3939

4040
# Store uploaded files on the local file system (see config/storage.yml for options)
41-
config.active_storage.service = :local
41+
config.active_storage.service = :azure
4242

4343
# Mount Action Cable outside main process or domain
4444
# config.action_cable.mount_path = nil

config/storage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ test:
22
service: Disk
33
root: <%= Rails.root.join("tmp/storage") %>
44

5-
local:
6-
service: Disk
7-
root: <%= Rails.root.join("storage") %>
5+
azure:
6+
service: AzureStorage
7+
storage_account_name: <%= ENV['AZURE_STORAGE_ACCOUNT_NAME'] %>
8+
storage_access_key: <%= ENV['AZURE_STORAGE_ACCESS_KEY'] %>
9+
container: <%= ENV['AZURE_STORAGE_CONTAINER'] %>
810

911
# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
1012
# amazon:
File renamed without changes.

db/migrate/20190726131532_devise_invitable_add_to_users.rb renamed to db/migrate/20190726131533_devise_invitable_add_to_users.rb

File renamed without changes.

0 commit comments

Comments
 (0)