Sha256: 61bce4bcb947643dcbba109b12c548c6433bf76f57c13a51579d37e38252d5a1

Contents?: true

Size: 1.84 KB

Versions: 10

Compression:

Stored size: 1.84 KB

Contents

module Dpl
  module Providers
    class Anynines < Provider
      status :alpha

      description sq(<<-str)
        tbd
      str

      env :anynines

      opt '--username USER',    'anynines username', required: true
      opt '--password PASS',    'anynines password', required: true, secret: true
      opt '--organization ORG', 'anynines organization', required: true
      opt '--space SPACE',      'anynines space', required: true
      opt '--app_name APP',     'Application name'
      opt '--buildpack PACK',   'Buildpack name or Git URL'
      opt '--manifest FILE',    'Path to the manifest'
      opt '--logout', default: true, internal: true

      API = 'https://api.de.a9s.eu'

      cmds install: 'test $(uname) = "Linux" && rel="linux64-binary" || rel="macosx64"; wget "https://cli.run.pivotal.io/stable?release=${rel}&source=github" -qO cf.tgz && tar -zxvf cf.tgz && rm cf.tgz',
           api:     './cf api %{url}',
           login:   './cf login -u %{username} -p %{password} -o %{organization} -s %{space}',
           push:    './cf push %{args}',
           logout:  './cf logout'

      errs install: 'Failed to install CLI tools',
           api:     'Failed to set api',
           login:   'Failed to login',
           target:  'Failed to target organization %{organization}, space %{space}',
           push:    'Failed to push app',
           logout:  'Failed to logout'

      def install
        shell :install
      end

      def login
        shell :api
        shell :login
      end

      def deploy
        shell :push
      end

      def finish
        shell :logout if logout?
      end

      private

        def url
          API
        end

        def args
          args = []
          args << quote(app_name)  if app_name?
          args << "-f #{manifest}" if manifest?
          args.join(' ')
        end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dpl-2.0.0.alpha.14 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.13 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.12 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.11 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.10 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.9 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.8 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.7 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.6 lib/dpl/providers/anynines.rb
dpl-2.0.0.alpha.5 lib/dpl/providers/anynines.rb