Skip to content

Instantly share code, notes, and snippets.

@fancyremarker
Created June 1, 2015 22:56
Show Gist options
  • Save fancyremarker/2d28413694fb3f946430 to your computer and use it in GitHub Desktop.
Save fancyremarker/2d28413694fb3f946430 to your computer and use it in GitHub Desktop.
[:octopus:] Set Aptible config variable from file
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