Forked from fancyremarker/set-config-from-file.rb
Last active
August 29, 2015 14:22
-
-
Save mseelig/c3a6249959f9c4df67cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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