Code Monkey home page Code Monkey logo

openshift-cdk-cart's Introduction

OpenShift Cartridge Development Kit

Make building and testing cartridges easy on OpenShift. The CDK runs as a cartridge on any OpenShift server supporting downloadable cartridges (Online, Origin) and can host the builds and source code of your application.

Installing the CDK

To get started, create a new app in OpenShift that uses the CDK cart:

rhc create-app mycart http://cdk-claytondev.rhcloud.com

Once the app is created, check your cartridge source code into the Git repository. If you want to fork an existing cartridge, just use the --from-code option. For example, if you wanted to fork the Go cartridge:

rhc create-app mycart http://cdk-claytondev.rhcloud.com --from-code=git://github.com/smarterclayton/openshift-go-cart.git

After the create completes you can visit your CDK app in the web, and you'll see information about your Git repository. The CDK will show info about your cart by reading your manifest.yml and build scripts.

Creating your own cart

The best reference right now is the cartridge writers guide. More docs and tutorials should be available soon.

Building your cart

If your cart needs to compile source into binaries in order to run on OpenShift, you'll want to execute a build. Like any other OpenShift application, your build hook is at .openshift/action_hooks/build. After checking in a build script and pushing your changes to the app, hit the app in the web.

You'll see a 'Builds' section with a form. In the form, enter the version of the cart you want to build (usually your master branch, but could be any other commit) and hit "Build Now".

By default, the CDK generates a password for you when you install it. This prevents people from running builds arbitrarily. The password is stored in the gear as an environment variable - to see it run:

$ rhc ssh mycart --gears 'env | grep CDK_PASSWORD'
lotsofrandomcharacters

When prompted for your password, enter "admin" as the user and the value you printed above as your password.

The CDK will now build your cart and display any output directly in the browser. The build will be stored on disk in your app.

Hit back and refresh the CDK page to get the latest build. Copy the build link and use it to create another app:

rhc create-app myapp <build_link>

or

rhc add-cartridge <build_link> -a myapp

If you want to debug the output of a build, SSH in to your app and run the build script manually:

$ rhc ssh mycart
Connecting to ....
$ cd $OPENSHIFT_REPO_DIR
$ .openshift/action_hooks/build

Future Features

  • Check your manifest for syntax errors and other common problems
  • Example cart manifests for different types of carts
  • Helpful scripts you can run while in the gear to debug problems or test changes
  • An acceptance test suite for cartridges

Pull requests welcome!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.