Sha256: f43e48feb42ba982867f97bc7c1feb94412ff632f6d0d3559176847510cd5f74
Contents?: true
Size: 1.82 KB
Versions: 4
Compression:
Stored size: 1.82 KB
Contents
require 'dply/helper' require 'dply/setup' require 'dply/yum' require 'dply/util' require 'forwardable' module Dply module Strategy class Git extend Forwardable include Helper attr_reader :config, :options def_delegators :config, :target, :branch, :config_map, :dir_map, :meta_conf def initialize(config, options) @config = config @options = options || {} end def deploy deploy_target = (target || :git) setup.git generate_meta_config Dir.chdir current_dir do previous_version = git.commit_id git_step current_version = git.commit_id link_all install_pkgs bundle.install bundle.clean util.run "deploy:#{deploy_target}", render_config: true util.report_changes(previous_version, current_version) end end def reload generate_meta_config Dir.chdir current_dir do link_all util.run :reload, render_config: true end end private def generate_meta_config meta_conf.generate if meta_conf end def current_dir @current_dir ||= "#{config.dir}/current" end def git_step return if options[:skip_git] if options[:no_pull] git.checkout branch else git.pull branch end end def link_all util.link "#{config.dir}/shared", dir_map util.link "#{config.dir}/config", config_map end def install_pkgs util.install_pkgs(build_mode: true) end def setup @setup ||= Setup.new(@config) end def util @util ||= Util.new end def bundle @bundle ||= Bundle.new end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
dply-0.3.5 | lib/dply/strategy/git.rb |
dply-0.3.4 | lib/dply/strategy/git.rb |
dply-0.3.3 | lib/dply/strategy/git.rb |
dply-0.3.2 | lib/dply/strategy/git.rb |