Sha256: e1786aa82509e8f1b0605f07264a893d1bb7ee2a362df9f60dc270813c669329

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

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')
        GitUtil.squash_commits(Docman::Application.instance.commit_count, nil, tag)
        GitUtil.push(root['full_build_path'], root.version(type: 'root'))
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
docman-0.0.99 lib/docman/deployers/git_deployer.rb
docman-0.0.98 lib/docman/deployers/git_deployer.rb
docman-0.0.97 lib/docman/deployers/git_deployer.rb
docman-0.0.96 lib/docman/deployers/git_deployer.rb
docman-0.0.95 lib/docman/deployers/git_deployer.rb
docman-0.0.94 lib/docman/deployers/git_deployer.rb
docman-0.0.93 lib/docman/deployers/git_deployer.rb
docman-0.0.92 lib/docman/deployers/git_deployer.rb
docman-0.0.91 lib/docman/deployers/git_deployer.rb
docman-0.0.90 lib/docman/deployers/git_deployer.rb
docman-0.0.89 lib/docman/deployers/git_deployer.rb
docman-0.0.88 lib/docman/deployers/git_deployer.rb
docman-0.0.87 lib/docman/deployers/git_deployer.rb
docman-0.0.86 lib/docman/deployers/git_deployer.rb