Sha256: 1b8326edd1ce1850ddc8873d0cc48571caff2ca85ba352b1f718037d2d342c1c

Contents?: true

Size: 939 Bytes

Versions: 112

Compression:

Stored size: 939 Bytes

Contents

module DPL
  class Provider
    class Openshift < Provider
      requires 'rhc'

      def api
        @api ||= ::RHC::Rest::Client.new(:user => option(:user), :password => option(:password), :server => 'openshift.redhat.com')
      end

      def user
        @user ||= api.user.login
      end

      def app
        @app ||= api.find_application(option(:domain), option(:app))
      end

      def check_auth
        log "authenticated as %s" % user
      end

      def check_app
        log "found app #{app.name}"
      end

      def setup_key(file, type = nil)
        specified_type, content, comment = File.read(file).split
        api.add_key(option(:key_name), content, type || specified_type)
      end

      def remove_key
        api.delete_key(option(:key_name))
      end

      def push_app
        context.shell "git push #{app.git_url} -f"
      end

      def restart
        app.restart
      end

    end
  end
end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
dpl-1.5.11.travis.430.1 lib/dpl/provider/openshift.rb
dpl-1.5.11.travis.414.1 lib/dpl/provider/openshift.rb
dpl-1.5.10 lib/dpl/provider/openshift.rb
dpl-1.5.10.travis.413.1 lib/dpl/provider/openshift.rb
dpl-1.5.10.travis.402.1 lib/dpl/provider/openshift.rb
dpl-1.6.0.travis.399.1 lib/dpl/provider/openshift.rb
dpl-1.5.9 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.397.1 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.394.1 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.393.1 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.390.1 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.373.1 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.372.1 lib/dpl/provider/openshift.rb
dpl-1.5.8 lib/dpl/provider/openshift.rb
dpl-1.5.9.travis.368.1 lib/dpl/provider/openshift.rb
dpl-1.5.8.travis.367.1 lib/dpl/provider/openshift.rb
dpl-1.5.8.travis.365.1 lib/dpl/provider/openshift.rb
dpl-1.5.8.travis.364.1 lib/dpl/provider/openshift.rb
dpl-1.5.8.travis.359.1 lib/dpl/provider/openshift.rb
dpl-1.5.8.travis.356.1 lib/dpl/provider/openshift.rb