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.4.6.travis.117.3 lib/dpl/provider/openshift.rb
dpl-1.4.6.travis.117.4 lib/dpl/provider/openshift.rb
dpl-1.4.6.travis.117.6 lib/dpl/provider/openshift.rb
dpl-1.4.6.travis.117.5 lib/dpl/provider/openshift.rb
dpl-1.4.6.travis.117.1 lib/dpl/provider/openshift.rb
dpl-1.4.6.travis.116.4 lib/dpl/provider/openshift.rb
dpl-1.4.5 lib/dpl/provider/openshift.rb
dpl-1.4.4 lib/dpl/provider/openshift.rb
dpl-1.4.3 lib/dpl/provider/openshift.rb
dpl-1.4.2 lib/dpl/provider/openshift.rb
dpl-1.4.1 lib/dpl/provider/openshift.rb
dpl-1.4.0 lib/dpl/provider/openshift.rb