modulesync 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80eb0fc8d80ef1b1c2ca334b6a3897b2ac43f7a6
4
- data.tar.gz: 64fdbe9a7c894d5cd284ac3c7431ccf78e12fb86
3
+ metadata.gz: 38b2eb4843e2a132da91b2bde013d8d648e6c007
4
+ data.tar.gz: 3d54efb0292a807e4f2b556662025884a855c4da
5
5
  SHA512:
6
- metadata.gz: 647516b662a2f16f9d728ef071713d9cecdbc96fc031635ff80b863898f448f1de190d953584c1d1146445cd2da0127f8a1fca25808d2ea10cf831a7a34b32dd
7
- data.tar.gz: d5448a82187ad533acc6bdbb3f9c4487211830c73350ce30c01e8e03dda69586c4e7f7443007e76ed40436371e03412b401c833f39fdfe5da1ba752980340243
6
+ metadata.gz: 7cb07104d0f07b006cde792d4b73d31a23f4a1c88024887bddb6f4e5408b9d99243665f99ba4beae40037c16b63a3f735a78138a8e424f75ad822684f225f527
7
+ data.tar.gz: 3aabccaa9cd274721fdefdea44b40ccf6a3acda3cb8ad603a16d3dc366df4c5596b45f565e25719c36b6ecfb0c287911e68b44026a81d16e20b6cb7346fc3d48
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  modules/
2
2
  *.gem
3
+ Gemfile.lock
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ ##2014-9-29 - 0.1.0
2
+
3
+ ### Summary
4
+
5
+ This release adds support for other SSH-based git servers, which means
6
+ gitlab is now supported.
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
2
 
3
- gem 'git'
3
+ gemspec
data/lib/modulesync.rb CHANGED
@@ -54,7 +54,7 @@ module ModuleSync
54
54
 
55
55
  managed_modules.each do |puppet_module|
56
56
  puts "Syncing #{puppet_module}"
57
- Git.pull(options[:namespace], puppet_module)
57
+ Git.pull(options[:git_user], options[:git_provider_address], options[:namespace], puppet_module)
58
58
  module_configs = Util.parse_config("#{PROJ_ROOT}/#{puppet_module}/#{MODULE_CONF_FILE}")
59
59
  files_to_manage = module_files | defaults.keys | module_configs.keys
60
60
  files_to_delete = []
@@ -10,6 +10,8 @@ module ModuleSync
10
10
  {
11
11
  :namespace => 'puppetlabs',
12
12
  :branch => 'master',
13
+ :git_user => 'git',
14
+ :git_provider_address => 'github.com',
13
15
  :managed_modules_conf => 'managed_modules.yml',
14
16
  :configs => '.',
15
17
  }
@@ -5,7 +5,6 @@ module ModuleSync
5
5
  MODULE_CONF_FILE = '.sync.yml'
6
6
  MODULESYNC_CONF_FILE = 'modulesync.yml'
7
7
  PROJ_ROOT = './modules'
8
- ENDPOINT = 'git@github.com'
9
8
  HOOK_FILE = '.git/hooks/pre-push'
10
9
  end
11
10
  end
@@ -4,7 +4,7 @@ module ModuleSync
4
4
  module Git
5
5
  include Constants
6
6
 
7
- def self.pull(org, name)
7
+ def self.pull(git_user, git_provider_address, org, name)
8
8
  if ! Dir.exists?(PROJ_ROOT)
9
9
  Dir.mkdir(PROJ_ROOT)
10
10
  end
@@ -12,8 +12,9 @@ module ModuleSync
12
12
  # Repo needs to be cloned in the cwd
13
13
  if ! Dir.exists?("#{PROJ_ROOT}/#{name}") || ! Dir.exists?("#{PROJ_ROOT}/#{name}/.git")
14
14
  puts "Cloning repository fresh"
15
- remote = "#{ENDPOINT}:#{org}/#{name}.git"
15
+ remote = "#{git_user}@#{git_provider_address}:#{org}/#{name}.git"
16
16
  local = "#{PROJ_ROOT}/#{name}"
17
+ puts "Cloning from #{remote}"
17
18
  repo = ::Git.clone(remote, local)
18
19
 
19
20
  # Repo already cloned, check out master and override local changes
@@ -7,6 +7,7 @@ module ModuleSync
7
7
  if File.exist?(config_file)
8
8
  YAML.load_file(config_file) || {}
9
9
  else
10
+ puts "No config file under #{config_file} found, using default values"
10
11
  {}
11
12
  end
12
13
  end
data/modulesync.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'modulesync'
7
- spec.version = '0.0.3'
7
+ spec.version = '0.1.0'
8
8
  spec.authors = ['Colleen Murphy']
9
9
  spec.email = ['colleen@puppetlabs.com']
10
10
  spec.summary = %q{Puppet Module Synchronizer}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulesync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colleen Murphy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-19 00:00:00.000000000 Z
11
+ date: 2014-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,8 +47,8 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - .gitignore
50
+ - CHANGELOG.md
50
51
  - Gemfile
51
- - Gemfile.lock
52
52
  - LICENSE
53
53
  - README.md
54
54
  - bin/msync
data/Gemfile.lock DELETED
@@ -1,10 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- git (1.2.7)
5
-
6
- PLATFORMS
7
- ruby
8
-
9
- DEPENDENCIES
10
- git