Skip to content

Instantly share code, notes, and snippets.

@mseelig
Forked from fancyremarker/set-config-from-file.rb
Last active August 29, 2015 14:22
Show Gist options
  • Save mseelig/c3a6249959f9c4df67cf to your computer and use it in GitHub Desktop.
Save mseelig/c3a6249959f9c4df67cf to your computer and use it in GitHub Desktop.
require 'aptible/auth'
require 'aptible/api'
HANDLE = 'your-app'
EMAIL = 'you@example.com'
PASSWORD = ''
KEY = 'FOOBAR'
FILE = '/path/to/file'
token = Aptible::Auth::Token.create(email: EMAIL, password: PASSWORD)
app = Aptible::Api::App.all(token: token).find do |app|
app.handle == HANDLE
end
operation = app.create_operation!(
type: 'configure',
env: { KEY => File.read(FILE) }
)
sleep 1 until operation.reload.status == 'succeeded'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment