Skip to content

Instantly share code, notes, and snippets.

@fancyremarker
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fancyremarker/35a654d6205d728a2b0e to your computer and use it in GitHub Desktop.
Save fancyremarker/35a654d6205d728a2b0e to your computer and use it in GitHub Desktop.
[:octopus:] Create an internal VHOST on Aptible
require 'aptible/auth'
require 'aptible/api'
token = Aptible::Auth::Token.create(
email: EMAIL,
password: PASSWORD
)
app = Aptible::Service.find(APP_ID, token: token)
service = app.services.find { |s| s.process_type == PROCESS_TYPE }
vhost = service.create_vhost!(
type: 'http_proxy_protocol',
virtual_domain: VIRTUAL_DOMAIN,
private_key: File.read(PRIVATE_KEY_FILE),
certificate: File.read(CERTIFICATE_FILE),
internal: true
)
provision = vhost.create_operation!(type: 'provision')
sleep 1 until provision.reload.status == 'succeeded'
@fancyremarker
Copy link
Author

Set the following variables:

  • EMAIL
  • PASSWORD
  • APP_ID
  • PROCESS_TYPE (usually "web")
  • VIRTUAL_DOMAIN
  • PRIVATE_KEY_FILE
  • CERTIFICATE_FILE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment