Sha256: 4d5fe18fb74c6f66952e02a58052cdbca16715509ba1e052c818accaeb95d4d1

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

module Dpl
  module Providers
    class Heroku
      class Git < Heroku
        register 'heroku:git'

        status :alpha

        full_name 'Heroku Git'

        description sq(<<-str)
          tbd
        str

        required :api_key, [:username, :password]

        opt '--api_key KEY',   'Heroku API key', secret: true
        opt '--username USER', 'Heroku username', alias: :user
        opt '--password PASS', 'Heroku password', secret: true
        opt '--git URL', 'Heroku Git remote URL'

        needs :git, :git_http_user_agent

        cmds fetch: 'git fetch origin $TRAVIS_BRANCH --unshallow',
             push:  'git push %{remote} HEAD:refs/heads/master -f'

        def prepare
          write_netrc if write_netrc?
        end

        def deploy
          shell :fetch, assert: false
          shell :push
        end

        private

          def remote
            git || "https://git.heroku.com/#{app}.git"
          end

          def write_netrc?
            remote.start_with?('https://')
          end

          def write_netrc
            super('git.heroku.com', email, api_key || password)
          end
      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/heroku/git.rb
dpl-2.0.0.alpha.13 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.12 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.11 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.10 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.9 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.8 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.7 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.6 lib/dpl/providers/heroku/git.rb
dpl-2.0.0.alpha.5 lib/dpl/providers/heroku/git.rb