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