Module: ChefWorkstationInitialize::SelfBootstrap::WithChef::GitHelpers

Includes:
CommandlineHelpers
Included in:
ChefHelpers
Defined in:
lib/selfbootstrap/withchef/git.rb

Instance Attribute Summary

Attributes included from NoChef::SelfBootstrapHelpers

#force_solo

Attributes included from NoChef::WorkstationHelpers

#workstationobj

Instance Method Summary collapse

Methods included from CommandlineHelpers

#run_options

Methods included from DefaultMethodsHelpers

#generate_directory, #worklog

Methods included from NoChef::SelfBootstrapHelpers

#boostrapp_once, #boostrapped?, #bootstrap_self, #bootstrap_self_command, #chef_client_self_bootstrap_cmd, #chef_solo_options, #chef_solo_options_command, #chef_solo_options_encode, #for_search_local_node?, #for_solo?, #install_this_gem, #is_boostrapping?, #is_self_bootsrapping?, #is_solo?, #remove_bootstrap_file, #restart_bootstrap, #run_as_root?, #set_chef_profile, #skip_boostrap?, #solo_options, #unauthorized_to_boostrap?

Methods included from NoChef::WorkstationResourceHelpers

#default_workstation_data, #get_workstation, #set_workstation_data, #set_workstation_resource, #swap_workstation, #workstation_resource, #workstation_resource_keys

Methods included from NoChef::WorkstationHelpers

#auto_repo, #bootstrapping_progress_file, #change_unix_permission, #create_main_generator, #main_generator_name, #new_cookbook_name, #node_infra_chef, #prepare_new_resource, #project_name, #workstation_acl_path, #workstation_berks_vendor_dir, #workstation_cache_dir, #workstation_cache_options_syntaxe_path, #workstation_cache_path, #workstation_checksum_path, #workstation_chef_environments_dir, #workstation_chef_repo_path, #workstation_client_d_dir, #workstation_client_key_path, #workstation_client_path, #workstation_config_d_dir, #workstation_config_dir, #workstation_container_path, #workstation_cookbook_artifact_path, #workstation_cookbooks_dir, #workstation_data_bags_dir, #workstation_download_dir, #workstation_file, #workstation_file_backup_path, #workstation_file_cache_path, #workstation_generators_dir, #workstation_group_path, #workstation_libraries_dir, #workstation_logs_dir, #workstation_nodes_dir, #workstation_ohai_segment_plugin_path, #workstation_policy_dir, #workstation_policy_files_dir, #workstation_policy_group_dir, #workstation_resources_dir, #workstation_roles_dir, #workstation_scripts_dir, #workstation_solo_d_dir, #workstation_syntax_check_cache_path, #workstation_trusted_certs_dir, #workstation_user_path

Methods included from NoChef::UsersHelpers

#create_group, #create_user, #generate_secret, #generate_ssh_user_key, #generate_user_data, #secretdatabag, #secretdatabagitem, #secretdatabagkey, #set_cookbook_user_secret_key, #user_fully_created?, #userdatabag

Methods included from NoChef::UpdateHelpers

#commit_state

Methods included from NoChef::KnifeHelpers

#get_solo_cmd, #is_knife?, #knife, #knife_get_node_attribute, #knife_search_self_cmd, #knife_self_bootstrap_cmd, #self_bootstrap_options

Methods included from NoChef::ChefRepoHelpers

#create_attribute_file, #create_chef_additionnal_dir, #create_chef_infra_cookbook, #create_cookbook, #create_generator, #create_recipe, #create_template_file, #define_cron_job, #ensure_main_environment, #project_environment_json, #project_role_json, #render_template, #write_Solo_file, #write_kitchen_file, #write_main_environment, #write_main_role, #write_main_role_environment, #write_role_environment

Methods included from NoChef::KitchenHelpers

#building_kitchen, #generate_kitchen, #generate_machine, #is_kitchen_command?, #kitchen, #kitchen_machine, #kitchen_root

Methods included from NoChef::ProvisionersHelpers

#chef_zero_provisioner, #provisioners

Methods included from NoChef::PlatformsHelpers

#default_platforms

Methods included from NoChef::SuitesHelpers

#default_suites

Methods included from NoChef::VerifiersHelpers

#inspec_verifier, #verifiers

Methods included from NoChef::ChefHelpers

#chef, #chef_client, #install_chef_workstation, #is_chef_cli_command?, #is_chef_client_command?, #is_chef_command?, #is_chef_enabled?, #is_chef_installed?, #is_chef_profile_set?, #is_chefworkstation_available?, #is_knife_gem_install?

Methods included from NoChef::BerksHelpers

#berks, #berks_vendor, #berks_vendor_all_cookbook, #berks_vendor_cookbook, #berks_vendor_init, #delete_all_berkslock, #delete_cookbook_berkslock, #reset_berks_vendor_dir, #self_berks_vendor

Methods included from NoChef::GitHelpers

#all_cookbooks, #generate_git_submodules, #generate_json_repo, #get_git_path, #get_git_relative_path, #get_self_git, #git_exec, #git_submodule_init, #repository_list

Methods included from NoChef::SSHHelpers

#delete_hostkey, #delete_hostkey_ip_or_name, #generate_private_key, #ssh, #ssh_command, #ssh_keygen

Methods included from NoChef::CommandlineHelpers

#base_command, #get_homedir, #is_mixlib_disabled?, #main_command, #run_options

Methods included from NoChef::DefaultMethodsHelpers

#analyse_object, #check_install_dir, #debug_worklog, #default_chefzero_portrange, #default_hostname, #default_install_dir, #define_resource_requirements, #error_worklog, #generate_default_install_dir, #generate_directory, #get_out_of_cache_path, #get_out_of_folder, #get_out_of_local_chef_path, #get_path, #is_chef_constant_enabled?, #parent_nil?, #require_implement_method, #search_local_project_folder, #warning_worklog, #worklog, #worklog_counter

Instance Method Details

#get_git_server(git_action) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/selfbootstrap/withchef/git.rb', line 52

def get_git_server(git_action)
  git_server project_name do
    repositories repository_list
    userdatabag 'users'
    secretdatabag cookbook_name
    secretdatabagitem 'cookbook_secret_keys'
    secretdatabagkey 'secret'
    userdatabagkey 'decompose_public_key'
    action git_action
  end
end

#get_git_submodule(git_name, git_info, action, compile_time) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/selfbootstrap/withchef/git.rb', line 29

def get_git_submodule(git_name, git_info, action, compile_time)
  # logger.warn("get_git_submodule of #{git_name} ==>\n#{git_info}")
  worklog("get_git_submodule of #{git_name} ==>\n#{git_info}")
  unless git_info.nil? || git_info['repository'].nil? || git_info['remote'].nil?
    git_submodule git_name do
      message "Get git_submodule #{git_name} for action #{action} at compile time #{compile_time} on remote '#{git_info['remote']}', repository #{git_info['repository']}, revision '#{git_info['revision']}', type '#{git_info['type']}', git_info '#{JSON.pretty_generate(git_info)}'"
      # build_method build_method
      destination (git_info['type'] == 'main_repo' || git_info['type'] == '' || git_info['type'].nil?) ? workstation_chef_repo_path : get_git_path(git_name)
      repository git_info['repository']
      revision git_info['revision']
      remote git_info['remote']
      checkout_branch "#{project_name}_#{workstation_resource[:environment]}"
      additional_remotes git_info['additional_remotes'] if git_info['additional_remotes']
      if git_info['submodules']
        submodules generate_git_submodules(git_info['submodules'])
        enable_submodules true
      end
      action action
      compile_time compile_time
    end ## end git
  end
end