corl 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 881f554ea8a48b043dcd9835c4cad50e4c2b51cb
4
- data.tar.gz: 1d1f66df8ea0a33900f95727620e033b99037583
3
+ metadata.gz: 7a8900e16b96f2022f8c52ed251802c43e5a9224
4
+ data.tar.gz: 357559d77d1dd84501a5284cbb199cd0c631d239
5
5
  SHA512:
6
- metadata.gz: 2ee65aa1433b07072305fd0e1a4d5d09e61255a59d013df507329681b01f8826084b65cb15edb097e0547278d151fa7129b9f1b3e6c5b2562e64cce309cd878d
7
- data.tar.gz: e49913e5c758ee2402edbde41061f0b70c1f2692a92c068a891c6f82d4a8e0035a1382455a4d5b14b07662ad9a0d3ab603440286ef1a4e2d4a7695bf94567aa8
6
+ metadata.gz: febc1d9a88160e7066180c423cf6fe2d3a5d610a3dd4a988c79873e55a5590d4e27221c29c9067bdca02eee11dd04b985cdf6668902ecd1fbac788374200bc3b
7
+ data.tar.gz: 3cc2e3bd2070075ce89166b1802f6049f68af56e027512ca16f1283a23e84cf1e49de6b0400964cba7376d844ce433a75ee83b31aeb21c744dc6bff415c08c14
data/README.rdoc CHANGED
@@ -1,26 +1,8 @@
1
- ## Welcome to CORL (Coral Orchestration and Research Library)
2
-
3
- CORL is a cloud application framework and command line utility that provides
4
- easy and extensible creation and management of project based networks and nodes
5
- and relevant infrastructure.
6
-
7
- The CORL system is built on top of our general purpose Nucleon application
8
- framework.
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
1
+ === CORL (Coral Orchestration and Research Library)
22
2
 
3
+ Coming soon!
23
4
 
5
+ Note: This library is still very early in development!
24
6
 
25
7
  ==== Contributing to CORL
26
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
@@ -17,26 +17,15 @@ function initialize_rvm_user()
17
17
  local PROFILE_FILE="${LOCAL_HOME}/.profile"
18
18
 
19
19
  local PATH_ENTRY='PATH=${PATH}:/usr/local/rvm/bin'
20
- local RVMSUDO_SECURE_PATH="export rvmsudo_secure_path=1"
21
- local SUDO_ALIAS="alias sudo=rvmsudo"
22
-
23
20
  local SCRIPT_INCLUDE="[[ -s '/usr/local/rvm/scripts/rvm' ]] && source '/usr/local/rvm/scripts/rvm'"
24
21
 
25
- echo "3. Initializing RVM user ${USER_NAME} group and environment settings"
26
- adduser "$USER_NAME" rvm >>/tmp/ruby.config.log 2>&1 || exit 52
22
+ echo "4. Initializing RVM user ${USER_NAME} group and environment settings"
23
+ adduser "$USER_NAME" rvm >>/tmp/ruby.config.log 2>&1 || exit 53
27
24
 
28
25
  if ! grep -Fxq "$PATH_ENTRY" "$PROFILE_FILE" >>/tmp/ruby.config.log 2>&1
29
26
  then
30
27
  echo "$PATH_ENTRY" >> "$PROFILE_FILE"
31
28
  fi
32
- if ! grep -Fxq "$RVMSUDO_SECURE_PATH" "$PROFILE_FILE" >>/tmp/ruby.config.log 2>&1
33
- then
34
- echo "$RVMSUDO_SECURE_PATH" >> "$PROFILE_FILE"
35
- fi
36
- if ! grep -Fxq "$SUDO_ALIAS" "$PROFILE_FILE" >>/tmp/ruby.config.log 2>&1
37
- then
38
- echo "$SUDO_ALIAS" >> "$PROFILE_FILE"
39
- fi
40
29
  if ! grep -Fxq "$SCRIPT_INCLUDE" "$BASHRC_FILE" >>/tmp/ruby.config.log 2>&1
41
30
  then
42
31
  echo "$SCRIPT_INCLUDE" >> "$BASHRC_FILE"
@@ -49,6 +38,17 @@ gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 >/tmp/ruby.config.log
49
38
  echo "2. Installing RVM"
50
39
  curl -sL https://get.rvm.io | bash -s stable >>/tmp/ruby.config.log 2>&1 || exit 51
51
40
 
41
+ if [ ! -e "/etc/profile.d/rvmsudo.sh" ]
42
+ then
43
+ echo "3. Adding a sudoers initialization file (compatible with RVM)"
44
+
45
+ ( cat <<'EOP'
46
+ export rvmsudo_secure_path=1
47
+ alias sudo=rvmsudo
48
+ EOP
49
+ ) > "/etc/profile.d/rvmsudo.sh" || exit 52
50
+ fi
51
+
52
52
  initialize_rvm_user 'root'
53
53
 
54
54
  for USER_HOME in /home/*/
@@ -60,18 +60,24 @@ do
60
60
  fi
61
61
  done
62
62
 
63
- echo "4. Installing Rubinius -- this will take some time"
64
- su - -c "rvm install rbx-2.3.0 --rubygems 2.4.2" root >>/tmp/ruby.config.log 2>&1 || exit 53
65
- su - -c "rvm use rbx-2.3.0 --default" root >>/tmp/ruby.config.log 2>&1 || exit 54
63
+ echo "5. Installing Rubinius -- this will take some time"
64
+
65
+ if [ -z "$RUBY_RVM_VERSION" ]
66
+ then
67
+ RUBY_RVM_VERSION='ruby-2.1'
68
+ fi
69
+
70
+ su - -c "rvm install $RUBY_RVM_VERSION" root >>/tmp/ruby.config.log 2>&1 || exit 54
71
+ su - -c "rvm use $RUBY_RVM_VERSION --default" root >>/tmp/ruby.config.log 2>&1 || exit 55
66
72
 
67
73
 
68
74
  if [ ! -e "/root/.gemrc" ]
69
75
  then
70
- echo "5. Adding an initial .gemrc configuration"
76
+ echo "6. Adding an initial .gemrc configuration"
71
77
 
72
78
  # Set Gem options
73
79
  ( cat <<'EOP'
74
80
  gem: --no-rdoc --no-ri
75
81
  EOP
76
- ) > "/root/.gemrc" || exit 55
82
+ ) > "/root/.gemrc" || exit 56
77
83
  fi
@@ -0,0 +1,58 @@
1
+ #!/bin/bash
2
+ #-------------------------------------------------------------------------------
3
+
4
+ PUPPET_PACKAGE="3.7.3-1puppetlabs1"
5
+
6
+ #---
7
+
8
+ # Set up Puppet Apt repositories
9
+ echo "1. Fetching Puppet keys"
10
+ apt-key adv --recv-key --keyserver pgp.mit.edu 4BD6EC30 >/tmp/puppet.key.log 2>&1 || exit 60
11
+
12
+ echo "2. Updating Puppet packages from source"
13
+ echo -e "# corl_puppet\ndeb http://apt.puppetlabs.com $OS_NAME main dependencies\ndeb-src http://apt.puppetlabs.com $OS_NAME main dependencies" | cat > /etc/apt/sources.list.d/corl_puppet.list || exit 61
14
+ chmod 0644 /etc/apt/sources.list.d/corl_puppet.list || exit 62
15
+ apt-get -y update >/tmp/puppet.update.log 2>&1 || exit 63
16
+
17
+ # Install Puppet
18
+ echo "3. Ensuring Puppet"
19
+
20
+ rm -f /etc/puppet/puppet.conf
21
+ rm -f /etc/hiera.yaml
22
+
23
+ apt-get -y install hiera puppet-common="$PUPPET_PACKAGE" puppet="$PUPPET_PACKAGE" >/tmp/puppet.install.log 2>&1 || exit 64
24
+ chown -R root:puppet /var/lib/puppet || exit 65
25
+
26
+ # Set up Hiera configuration
27
+ mkdir -p /var/corl/config || exit 66
28
+
29
+ echo "4. Configuring Puppet"
30
+ ( cat <<'EOP'
31
+ [main]
32
+ logdir=/var/log/puppet
33
+ vardir=/var/lib/puppet
34
+ ssldir=/var/lib/puppet/ssl
35
+ rundir=/var/run/puppet
36
+ factpath=$vardir/lib/facter
37
+ EOP
38
+ ) > /etc/puppet/puppet.conf || exit 67
39
+
40
+
41
+ echo "5. Configuring Hiera"
42
+
43
+ ( cat <<'EOP'
44
+ ---
45
+ :merge_behavior: deeper
46
+ :backends:
47
+ - yaml
48
+ - json
49
+ :yaml:
50
+ :datadir: /var/corl/config
51
+ :json:
52
+ :datadir: /var/corl/config
53
+ :hierarchy:
54
+ - common
55
+ EOP
56
+ ) > /etc/hiera.yaml || exit 68
57
+
58
+ chmod 0440 /etc/hiera.yaml || exit 69
@@ -27,28 +27,4 @@ then
27
27
  else
28
28
  echo "2. Installing latest release of CORL"
29
29
  su - -c "gem install corl" root >/tmp/corl.install.log 2>&1 || exit 102
30
- fi
31
-
32
- # Set up Hiera configuration
33
- mkdir -p /var/corl/config || exit 108
34
-
35
- if [ ! -e /etc/hiera.yaml ]
36
- then
37
- echo "5. Configuring Hiera"
38
-
39
- ( cat <<'EOP'
40
- ---
41
- :merge_behavior: deeper
42
- :backends:
43
- - yaml
44
- - json
45
- :yaml:
46
- :datadir: /var/corl/config
47
- :json:
48
- :datadir: /var/corl/config
49
- :hierarchy:
50
- - common
51
- EOP
52
- ) > /etc/hiera.yaml || exit 109
53
- chmod 0440 /etc/hiera.yaml || exit 110
54
- fi
30
+ fi
data/corl.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: corl 0.5.4 ruby lib
5
+ # stub: corl 0.5.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "corl"
9
- s.version = "0.5.4"
9
+ s.version = "0.5.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Adrian Webb"]
14
- s.date = "2014-12-04"
14
+ s.date = "2014-12-27"
15
15
  s.description = "Framework that provides a simple foundation for growing organically in the cloud"
16
16
  s.email = "adrian.webb@coralnexus.com"
17
17
  s.executables = ["corl"]
@@ -43,11 +43,13 @@ Gem::Specification.new do |s|
43
43
  "bootstrap/os/ubuntu/01_git.sh",
44
44
  "bootstrap/os/ubuntu/02_editor.sh",
45
45
  "bootstrap/os/ubuntu/05_ruby.sh",
46
+ "bootstrap/os/ubuntu/06_puppet.sh",
46
47
  "bootstrap/os/ubuntu/09_nucleon.sh",
47
48
  "bootstrap/os/ubuntu/10_corl.sh",
48
49
  "corl.gemspec",
49
50
  "lib/CORL/builder/identity.rb",
50
51
  "lib/CORL/builder/package.rb",
52
+ "lib/CORL/builder/project.rb",
51
53
  "lib/CORL/configuration/file.rb",
52
54
  "lib/CORL/machine/AWS.rb",
53
55
  "lib/CORL/machine/physical.rb",
@@ -2,10 +2,10 @@
2
2
  module CORL
3
3
  module Builder
4
4
  class Identity < Nucleon.plugin_class(:CORL, :builder)
5
-
5
+
6
6
  #-----------------------------------------------------------------------------
7
7
  # Identity plugin interface
8
-
8
+
9
9
  def normalize(reload)
10
10
  super do
11
11
  @identities = {}
@@ -14,33 +14,33 @@ class Identity < Nucleon.plugin_class(:CORL, :builder)
14
14
 
15
15
  #-----------------------------------------------------------------------------
16
16
  # Property accessors / modifiers
17
-
17
+
18
18
  def build_directory
19
19
  File.join(network.directory, 'config', 'identities')
20
20
  end
21
-
21
+
22
22
  #---
23
-
23
+
24
24
  def identities
25
25
  @identities
26
26
  end
27
-
27
+
28
28
  def set_identity(name, directory)
29
29
  @identities[name] = directory
30
30
  end
31
-
31
+
32
32
  #-----------------------------------------------------------------------------
33
33
  # Identity interface operations
34
-
34
+
35
35
  def build_provider(name, project_reference, environment)
36
36
  provider_id = id(name)
37
37
  directory = File.join(internal_path(build_directory), provider_id.to_s)
38
38
  success = true
39
-
39
+
40
40
  info("Building identity #{blue(name)} at #{purple(project_reference)} into #{green(directory)}", { :i18n => false })
41
-
41
+
42
42
  full_directory = File.join(network.directory, directory)
43
-
43
+
44
44
  unless identities.has_key?(provider_id)
45
45
  project = build_config.manage(:project, extended_config(:identity, {
46
46
  :directory => full_directory,
@@ -54,16 +54,16 @@ class Identity < Nucleon.plugin_class(:CORL, :builder)
54
54
  warn("Identity #{cyan(name)} failed to initialize", { :i18n => false })
55
55
  success = false
56
56
  end
57
-
57
+
58
58
  if success
59
59
  # Make thid project private.
60
60
  FileUtils.chmod_R('go-wrx', full_directory)
61
-
61
+
62
62
  set_identity(provider_id, full_directory)
63
63
  build_config.set_location(plugin_provider, name, directory)
64
64
  end
65
65
  end
66
- success("Build of identity #{blue(name)} finished", { :i18n => false }) if success
66
+ #success("Build of identity #{blue(name)} finished", { :i18n => false }) if success
67
67
  success
68
68
  end
69
69
  end
@@ -2,10 +2,10 @@
2
2
  module CORL
3
3
  module Builder
4
4
  class Package < Nucleon.plugin_class(:CORL, :builder)
5
-
5
+
6
6
  #-----------------------------------------------------------------------------
7
7
  # Package plugin interface
8
-
8
+
9
9
  def normalize(reload)
10
10
  super do
11
11
  @packages = {}
@@ -14,33 +14,33 @@ class Package < Nucleon.plugin_class(:CORL, :builder)
14
14
 
15
15
  #-----------------------------------------------------------------------------
16
16
  # Property accessors / modifiers
17
-
17
+
18
18
  def build_directory
19
19
  File.join(network.build_directory, 'packages')
20
20
  end
21
-
21
+
22
22
  #---
23
-
23
+
24
24
  def packages
25
25
  @packages
26
26
  end
27
-
27
+
28
28
  def set_package(name, directory)
29
29
  @packages[name] = directory
30
30
  end
31
-
31
+
32
32
  #-----------------------------------------------------------------------------
33
33
  # Package interface operations
34
-
34
+
35
35
  def build_provider(name, project_reference, environment)
36
36
  provider_id = id(name)
37
37
  directory = File.join(internal_path(build_directory), provider_id.to_s)
38
38
  success = true
39
-
39
+
40
40
  info("Building package #{blue(name)} at #{purple(project_reference)} into #{green(directory)}", { :i18n => false })
41
-
41
+
42
42
  full_directory = File.join(network.directory, directory)
43
-
43
+
44
44
  unless packages.has_key?(provider_id)
45
45
  project = build_config.manage(:configuration, extended_config(:package, {
46
46
  :directory => full_directory,
@@ -52,22 +52,22 @@ class Package < Nucleon.plugin_class(:CORL, :builder)
52
52
  warn("Package #{cyan(name)} failed to initialize", { :i18n => false })
53
53
  success = false
54
54
  end
55
-
55
+
56
56
  if success
57
57
  set_package(provider_id, full_directory)
58
-
58
+
59
59
  build_config.import(project)
60
60
  build_config.set_location(plugin_provider, name, directory)
61
-
61
+
62
62
  if project.get([ :builders, plugin_provider ], false)
63
- sub_packages = process_environment(project.get_hash([ :builders, plugin_provider ]), environment)
64
-
65
- status = parallel(:build_provider, sub_packages, environment)
63
+ sub_packages = process_environment(project.get_hash([ :builders, plugin_provider ]), environment)
64
+
65
+ status = parallel(:build_provider, sub_packages, environment)
66
66
  success = false if status.values.include?(false)
67
67
  end
68
68
  end
69
69
  end
70
- success("Build of package #{blue(name)} finished", { :i18n => false }) if success
70
+ #success("Build of package #{blue(name)} finished", { :i18n => false }) if success
71
71
  success
72
72
  end
73
73
  end
@@ -0,0 +1,37 @@
1
+
2
+ module CORL
3
+ module Builder
4
+ class Project < Nucleon.plugin_class(:CORL, :builder)
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Project interface operations
8
+
9
+ def build_provider(provider_path, project_reference, environment)
10
+ path = provider_path.to_s
11
+ success = true
12
+
13
+ info("Building project #{purple(project_reference)} into #{green(path)}", { :i18n => false })
14
+
15
+ full_directory = File.join(network.directory, path)
16
+ project = build_config.manage(:project, extended_config(:project, {
17
+ :directory => full_directory,
18
+ :url => project_reference,
19
+ :create => File.directory?(full_directory) ? false : true,
20
+ :pull => true,
21
+ :internal_ip => CORL.public_ip, # Needed for seeding Vagrant VMs
22
+ :manage_ignore => false,
23
+ :corl_file => false
24
+ }))
25
+ unless project
26
+ warn("Project #{cyan(path)} failed to initialize", { :i18n => false })
27
+ success = false
28
+ end
29
+ if success
30
+ #success("Build of project #{blue(path)} finished", { :i18n => false })
31
+ network.ignore(path)
32
+ end
33
+ success
34
+ end
35
+ end
36
+ end
37
+ end