Sha256: f46bc85ed08a5ff98ba3b55d5915f28024590192c137bdce603f606de5510e43

Contents?: true

Size: 1.08 KB

Versions: 16

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

    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
docman-0.0.85 lib/docman/deployers/git_deployer.rb
docman-0.0.84 lib/docman/deployers/git_deployer.rb
docman-0.0.83 lib/docman/deployers/git_deployer.rb
docman-0.0.82 lib/docman/deployers/git_deployer.rb
docman-0.0.81 lib/docman/deployers/git_deployer.rb
docman-0.0.80 lib/docman/deployers/git_deployer.rb
docman-0.0.79 lib/docman/deployers/git_deployer.rb
docman-0.0.78 lib/docman/deployers/git_deployer.rb
docman-0.0.77 lib/docman/deployers/git_deployer.rb
docman-0.0.76 lib/docman/deployers/git_deployer.rb
docman-0.0.75 lib/docman/deployers/git_deployer.rb
docman-0.0.74 lib/docman/deployers/git_deployer.rb
docman-0.0.73 lib/docman/deployers/git_deployer.rb
docman-0.0.72 lib/docman/deployers/git_deployer.rb
docman-0.0.71 lib/docman/deployers/git_deployer.rb
docman-0.0.70 lib/docman/deployers/git_deployer.rb