Sha256: a0906622ab21dd9fa670cd7fe694875dee9b232746008eb059624f913225d88a

Contents?: true

Size: 1.72 KB

Versions: 15

Compression:

Stored size: 1.72 KB

Contents

module Context
  module RubyDeployerHelper
    def ruby_build(context)
      git_build(context)
      Dir.chdir context.context_folder
      puts "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created"
      check_folder get_context_folder(context, 'build')
    end

    def ruby_release(context)
      Dir.chdir context.context_folder
      # gem ["push #{context.context_name}-#{GVB.version}.gem"]
      rake ['release']
    end

    def ruby_install(context)
      Dir.chdir context.context_folder
      gem ['install', context.context_name]
    end

    def clean_folder(context, folder)
      clean_folder = get_context_folder(context, folder)
      puts "Clean folder #{clean_folder}"
      FileUtils.remove_dir(clean_folder) if Dir.exist?(clean_folder)
    end

    def ruby_clean(context)
      clean_folder(context, 'pkg')
    end

    def ruby_remove_gem(context)
      clean_folder(context, 'pkg')
    end

    def ruby_check_if_available_public(context)
      puts "Waiting a minute before installing"
      `chef gem list #{context.context_name}`
      # sleep(60)
    end

    def ruby_cycle(context)
      if context.new_update_available?
        context.clean
        context.build
        context.commit
        context.release
        context.wait_until_release_available
        context.install
        if context.test_context_successful?
          puts "newer version installed successfully for #{context.context_name} on version #{context.version}"
          context.patch_bump
          # patch_reset(context)
        else
          puts "newer version not installed for #{context.context_name} on version #{context.version}"
        end
      else
        puts "No update available"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
deploy-context-2.0.4 lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.3 lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.2.1.g00ce101 lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.2 lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.1.1.g34e199f lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.1 lib/deploy-context/deploy/ruby.rb
deploy-context-2.0.0.1.gae09dc8 lib/deploy-context/deploy/ruby.rb
deploy-context-1.0.0 lib/deploy-context/deploy/ruby.rb
deploy-context-0.13.0.1.g5a3c3d4 lib/deploy-context/deploy/ruby.rb
deploy-context-0.12.0 lib/deploy-context/deploy/ruby.rb
deploy-context-0.11.57.1.ga274362.1.g8977db8.3.g30c6ab3.1.g83cd298 lib/deploy-context/deploy/ruby.rb
deploy-context-0.11.57.1.ga274362.1.g8977db8.3.g30c6ab3 lib/deploy-context/deploy/ruby.rb
deploy-context-0.11.57.1.ga274362.1.g8977db8.2.g07fba0a lib/deploy-context/deploy/ruby.rb
deploy-context-0.11.57.1.ga274362.1.g8977db8 lib/deploy-context/deploy/ruby.rb
deploy-context-0.11.57.1.ga274362 lib/deploy-context/deploy/ruby.rb