Name |
Ceylon OpenShift Platform Module |
---|---|
Category |
Command-line plugins
Modules which have command-line plugins available. You can install them with |
Backends | JVM |
Maven coordinates | |
Compatible Ceylon release |
JVM: 1.1.0 (outdated) |
Published | Apr 4, 2015 |
Stats |
Downloads (JVM): 7911 Source downloads: 507 |
Authors |
Stephane Epardaud |
Description |
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. Usagevoid connectToDb(String jdbcUrl, String user, String password){ // … } void startHttpServer(String ip, Integer port){ // … } shared void run(){ if(openshift.running){ if(openshift.ceylon.running){ startHttpServer(openshift.ceylon.ip, openshift.ceylon.port); }else if(openshift.vertx.running){ startHttpServer(openshift.vertx.ip, openshift.vertx.port); }else{ // other cartridge? } if(openshift.postgres.running){ 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); }else{ // other db? } } } CLI plugin usageIf 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 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 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 https://raw.github.com/ceylon/openshift-cartridge/master/metadata/manifest.yml |
Dependencies |
java.base/7 JDK
|
Usage |
import ceylon.openshift "1.1.1"; $ ceylon plugin install ceylon.openshift/1.1.1 <property name="ceylon.home" value="…"/> <property name="ceylon.ant.lib" value="${ceylon.home}/lib/ceylon-ant.jar"/> <path id="ant-tasks"> <pathelement path="${ceylon.ant.lib}"/> </path> <typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/> <target name="run"> <ceylon-plugin mode=install module="ceylon.openshift/1.1.1"/> </target> |
Module links |
Members Imported By Browse Download .car No .js archive Download source archive Download scripts archive Scripts Download module documentation View API documentation |