Sha256: fbbd4f0957942d842513a172ed968834b5e1fe49a1ff6b703443894978ff3c46

Contents?: true

Size: 1013 Bytes

Versions: 17

Compression:

Stored size: 1013 Bytes

Contents

module Docman
  module Deployers
    class GitDeployer < Deployer

      register_deployer :git_deployer

      def push
        root = @docroot_config.root
        root.state_name = self['state']
        tag = nil

        if self['environment'].has_key?('tagger')
          filepath = File.join(root['full_build_path'], 'VERSION')
          prev_version = File.file?(filepath) ? File.open(filepath) : nil
          params = self['environment']['tagger']
          params['prev_version'] = prev_version
          version = Docman::Taggers::Tagger.create(params, root, self).perform
          File.open(filepath, 'w') {|f| f.write(version) }

          filepath = File.join(root['full_build_path'], 'version.properties')
          File.open(filepath, 'w') {|f| f.write("tag=#{version}") }

          tag = version
        end

        GitUtil.commit(root['full_build_path'], root['full_build_path'], 'Updated version', tag)
        GitUtil.push(root['full_build_path'], root.version)
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
docman-0.0.69 lib/docman/deployers/git_deployer.rb
docman-0.0.68 lib/docman/deployers/git_deployer.rb
docman-0.0.67 lib/docman/deployers/git_deployer.rb
docman-0.0.66 lib/docman/deployers/git_deployer.rb
docman-0.0.65 lib/docman/deployers/git_deployer.rb
docman-0.0.64 lib/docman/deployers/git_deployer.rb
docman-0.0.63 lib/docman/deployers/git_deployer.rb
docman-0.0.62 lib/docman/deployers/git_deployer.rb
docman-0.0.61 lib/docman/deployers/git_deployer.rb
docman-0.0.60 lib/docman/deployers/git_deployer.rb
docman-0.0.59 lib/docman/deployers/git_deployer.rb
docman-0.0.58 lib/docman/deployers/git_deployer.rb
docman-0.0.57 lib/docman/deployers/git_deployer.rb
docman-0.0.56 lib/docman/deployers/git_deployer.rb
docman-0.0.55 lib/docman/deployers/git_deployer.rb
docman-0.0.54 lib/docman/deployers/git_deployer.rb
docman-0.0.53 lib/docman/deployers/git_deployer.rb