# frozen_string_literal: true require_relative 'project' require_relative 'cookbook' # DeployRubygem - deploy a gem using rake # Containing a class module DeployRubygem # Using Rubygem to deploy and manage Rubygem class Rubygem < Project def deploy_dependencies dependencies.each do |git_depends| Dir.chdir(::File.join(ENV['HOME'], git_depends)) system('git pull') system('git add .') system("git commit -m \"Deploying #{project_name}_$(git version-bump show)\"") system('git push') end end def git_prepare binaries.each do |executable| system("git add bin/#{executable}") end system('git add deploy_rubygem.gemspec') system('git add .circleci/config.yml') system('git add lib') end def git_sync Dir.chdir(path) system('git pull') end def push_minor_bump system("git commit -m \"Deploying #{project_name}_$(git version-bump show)\"") system('git version-bump patch') # system('gem build') system('gem push deploy_rubygem-$(git version-bump show).gem') system('git version-bump minor') # end def deploy_with_git deploy_dependencies git_sync git_prepare push_minor_bump end def rake_test File.delete('Gemfile.lock') if File.exist?('Gemfile.lock') system('bundle') || return system('bundle install') || return system('rake') || return # system('rake build') && # system('rake install:local') && end def rake_release change_to_project_folder git_commit system('rake install') || abort("Cannot rake install #{project_name} #{GVB.version}") # system('rake release') || exit(105) end def release change_to_project_folder rake_test rake_release end def deploy change_to_chefrepo deploy_cookbooks change_to_project_folder # release test_compliance end end end