Source Code

This module allows you to check if you are running on openshift and if yes to get information about the host/ip you should bind on, your public dns and database information.


void connectToDb(String jdbcUrl, String user, String password){ // … }

void startHttpServer(String ip, Integer port){ // … }

shared void run(){ if(openshift.running){

  startHttpServer(openshift.ceylon.ip, openshift.ceylon.port);
}else if(openshift.vertx.running){
  startHttpServer(openshift.vertx.ip, openshift.vertx.port);
  // other cartridge?
  connectToDb(openshift.postgres.jdbcUrl, openshift.postgres.user, openshift.postgres.password);
}else if(openshift.mysql.running){
  connectToDb(openshift.mysql.jdbcUrl, openshift.mysql.user, openshift.mysql.password);
  // other db?

} }

CLI plugin usage

If you want to use the CLI plugin to turn your application into an OpenShift application running on the Ceylon cartridge.

Now you just have to add the required OpenShift setup to your application, for which you can install the ceylon openshift command (only need to do this once):

$ ceylon plugin install ceylon.openshift/1.1.0

And now you just turn your Ceylon application into a Ceylon OpenShift application:

$ ceylon openshift init your.main.module/1.0

This will create the necessary setup files in the .openshift directory as described in the Ceylon cartridge help.

Now you're ready to start, so just push your code somewhere over git and create your OpenShift application with the Ceylon cartridge:

$ rhc create-app --from-code <your-git-url> ceylonapp
By: Stephane Epardaud
openshiftSource Codeshared openshift openshift

Contains information related to your OpenShift deployment

CartridgeSource Codeshared Cartridge

Represents an OpenShift Cartridge

DataBaseSource Codeshared DataBase

Represents an OpenShift DataBase

openshiftSource Codeshared openshift

Contains information related to your OpenShift deployment