Sha256: cff2f2ba9f99095e2b6bfa29186039abc29f57158431b935f5690d38483d1f51

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

module Context
  module GitDeployerHelper
    def git_build(context)
      Dir.chdir File.dirname(context.context_folder)
      puts "Building ruby from folder #{context.context_folder}"
      if ::Dir.exist?(context.context_folder)
        git_pull(context)
      else
        git ["clone git@github.com:JimboDragonGit/#{context.context_name}.git"] unless ::Dir.exist?(context.context_folder)
      end
    end

    def git_pull(context)
      Dir.chdir context.context_folder
      git ['pull']
    end

    def git_commit(context)
      Dir.chdir context.context_folder
      git ['add .']
      git ["commit -m 'Create #{context.context_name} automatic commit'"]
    end

    def git_release(context)
      Dir.chdir context.context_folder
      git ['push', '--follow-tags']
    end

    def git_bump(context, level)
      Dir.chdir context.context_folder
      git ['version-bump', level]
    end

    def patch_reset(context)
      git_bump(context, 'minor')
      git_commit(context)
    end

    def git_update_available?(context)
      git_build(context)
      git ['log', "v#{context.version}"]
      # git ['ls-remote origin', "v#{context.version}"]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deploy-context-0.11.44 lib/deploy-context/deploy/git.rb