Sha256: df388ecdf73d57f5623504e5a0455d7aa9177547e1044b83403d4508a4998b76

Contents?: true

Size: 883 Bytes

Versions: 6

Compression:

Stored size: 883 Bytes

Contents

class ReleaseXing
  TMP_FOLDER_NAME = ('_RENUO_RELEASE_TEMP_' + rand(100_000_000).to_s).freeze
  MOVE_TO_TMP_FOLDER = "mkdir -p #{TMP_FOLDER_NAME} && cd #{TMP_FOLDER_NAME}".freeze

  def run
    checkout_project
    cmd_in_folder 'git remote add -f renuo git@github.com:renuo/xing-campaign.git'
    cmd_in_folder 'git pull'
    cmd_in_folder 'git fetch renuo develop'
    cmd_in_folder 'git subtree pull --prefix public renuo develop --squash'
    cmd_in_folder 'git push'
  ensure
    cleanup
  end

  private

  def checkout_project
    system "#{MOVE_TO_TMP_FOLDER} && git clone git@gitlab.dc.xing.com:renuo-ag/wunsch-arbeitgeber.xing.com.git"
  end

  def cmd_in_folder(command)
    system "#{move_and_cd} && #{command}"
  end

  def move_and_cd
    "#{MOVE_TO_TMP_FOLDER} && cd wunsch-arbeitgeber.xing.com"
  end

  def cleanup
    system("rm -rf #{TMP_FOLDER_NAME}")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
renuo-cli-1.7.3 lib/renuo/cli/app/release_xing.rb
renuo-cli-1.7.2 lib/renuo/cli/app/release_xing.rb
renuo-cli-1.7.1 lib/renuo/cli/app/release_xing.rb
renuo-cli-1.7.0 lib/renuo/cli/app/release_xing.rb
renuo-cli-1.6.0 lib/renuo/cli/app/release_xing.rb
renuo-cli-1.5.0 lib/renuo/cli/app/release_xing.rb