Sha256: b4213bb7e246ddd682eb64469aaa5692d15c13e80ad56bd4e8fd67baa9e729cd

Contents?: true

Size: 2 KB

Versions: 12

Compression:

Stored size: 2 KB

Contents

require 'git_utils'
require 'r10k_utils'
require 'master_manipulator'
test_name 'Verify the same remote can be used in more than one object'

env_path = on(master, puppet('config print environmentpath')).stdout.rstrip
r10k_fqp = get_r10k_fqp(master)
git_environments_path = '/root/environments'
git_repo_path = '/git_repos'
git_repo_name = 'environments'
git_control_remote = File.join(git_repo_path, "#{git_repo_name}.git")
code_dir = "#{env_path}/production"

last_commit = git_last_commit(master, git_environments_path)
git_provider = ENV['GIT_PROVIDER']
r10k_config_path = get_r10k_config_file_path(master)
r10k_config_bak_path = "#{r10k_config_path}.bak"
#In-line files
r10k_conf = <<-CONF
cachedir: '/var/cache/r10k'
git:
  provider: '#{git_provider}'
sources:
  control:
    basedir: "#{env_path}"
    remote: "#{git_control_remote}"
CONF

# Install the same module in two different places
puppetfile = <<-EOS
mod 'prod_apache',
  :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
  :tag => 'v6.0.0'

mod 'test_apache',
  :git => 'git://github.com/puppetlabs/puppetlabs-apache.git',
  :tag => 'v6.0.0'
EOS

teardown do
  step 'Restore Original "r10k" Config'
  on(master, "mv #{r10k_config_bak_path} #{r10k_config_path}")

  clean_up_r10k(master, last_commit, git_environments_path)
end

step 'Stub the forge'
stub_forge_on(master)

step 'Backup Current "r10k" Config'
on(master, "mv #{r10k_config_path} #{r10k_config_bak_path}")

step 'Update the "r10k" Config'
create_remote_file(master, r10k_config_path, r10k_conf)

step 'Ask r10k to deploy'
on(master, "#{r10k_fqp} deploy environment -p")

step 'Add puppetfile with repeated remote'
create_remote_file(master, "#{git_environments_path}/Puppetfile", puppetfile)
git_add_commit_push(master, 'production', 'add Puppetfile', git_environments_path)

step 'Deploy r10k'
on(master, "#{r10k_fqp} deploy environment -p")

step 'Verify module was installed in both places'
on(master, "test -d #{code_dir}/modules/prod_apache")
on(master, "test -d #{code_dir}/modules/test_apache")

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
r10k-3.14.2 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.14.1 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.14.0 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.13.0 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.12.1 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.12.0 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.11.0 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.10.0 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.9.3 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.9.2 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.9.1 integration/tests/git_source/git_source_repeated_remote.rb
r10k-3.9.0 integration/tests/git_source/git_source_repeated_remote.rb