Skip to content

Commit

Permalink
Added env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sternj committed Sep 10, 2019
1 parent 41f4faf commit 3f873e7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
55 changes: 26 additions & 29 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/jobs/run_moss_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ class RunMossJob < ApplicationJob

SECRET_KEY = ENV['SECRET_KEY']
ACCESS_KEY = ENV['ACCESS_KEY']
MOSS_KEY = ENV['MOSS_KEY']
def perform(assignment_id, image_name, files, base_uri)
image = Container.find_by(name: image_name)
puts image.uid
container = Docker::Container.create('Image' => image.uid,
'Env' => ["AWS_SECRET_ACCESS_KEY=#{SECRET_KEY}", "AWS_ACCESS_KEY_ID=#{ACCESS_KEY}"],
'Env' => ["AWS_SECRET_ACCESS_KEY=#{SECRET_KEY}", "AWS_ACCESS_KEY_ID=#{ACCESS_KEY}", "MOSS_KEY=#{MOSS_KEY}"],
'Cmd' => ['ruby', 'moss.rb'] + [base_uri] + files,
'Tty' => true)
container.tap(&:start).attach(:tty => true)
Expand Down

0 comments on commit 3f873e7

Please sign in to comment.