This article shows you how to get a ssh connection to your application running on anynines using a modificated version of this script provided by a member of the Cloud Foundry community and the tmate service (Note that the tmate service is not hosted by anynines).
To simplify the setup of a tmate session download and install this helper script which will provide you a simple command to open a ssh connection.
Linux and MacOS X users can do this by just executing these two commands:
$ wget https://raw.githubusercontent.com/anynines/tmate-bootstrap/master/scripts/cf-ssh -O /usr/local/bin/cf-ssh
$ chmod +x /usr/local/bin/cf-ssh
Afterwards go to your application directory and execute:
CF_SSH_CLEANUP=keep cf-ssh [appname]
If your application depends on a specific buildpack use the command with the following option and replace the buildpack URL:
CF_SSH_CLEANUP=keep cf-ssh [appname] -b https://github.com/heroku/heroku-buildpack-ruby
After a while you will find yourself in a ssh session connected to a container with the same environment your application has:
executing cf-ssh creates a file inside your working directory named “cf-ssh.yml”. The file will be used to deploy an application you will get connected to. After you close the ssh connection the application gets stopped.
Executing the cf-ssh command without the CF_SSH_CLEANUP option will cause the deletion of the additional deployed application.
Please sign in to leave a comment.