Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Changes to be able to build ng and v1.
Browse files Browse the repository at this point in the history
Change-Id: I0eea1b207cd48f0c3cb9567c89148dc6435b1f49
  • Loading branch information
Maria Shaldybina and Matthew Boedicker committed Jan 16, 2013
1 parent 4947b89 commit 9fb7b90
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 4 deletions.
6 changes: 4 additions & 2 deletions micro/lib/micro/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ def update_spec
properties = @spec['properties']

properties['domain'] = subdomain
properties['cc']['srv_api_uri'] = "http://api.#{subdomain}"
properties['cc']['admins'] = admins
cc_props = properties['cc_props'] || 'cc'
cc_host = cc_props == "ccng" ? "ccng" : "api"
properties[cc_props]['srv_api_uri'] = "http://#{cc_host}.#{subdomain}"
properties[cc_props]['admins'] = admins

env = properties['env']
if @identity.proxy.url.empty?
Expand Down
9 changes: 7 additions & 2 deletions micro/lib/micro/apply_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ def properties
@spec['properties'] ||= {}
end

def cc_props
properties['cc_props'] || 'cc'
end

def cc
properties['cc'] ||= {}
properties[cc_props] ||= {}
end

def env
Expand Down Expand Up @@ -79,7 +83,8 @@ def domain

def domain=(domain)
properties['domain'] = domain
cc['srv_api_uri'] = "http://api.#{domain}/"
cc_host = cc_props == "ccng" ? "ccng" : "api"
cc['srv_api_uri'] = "http://#{cc_host}.#{domain}/"
end

def http_proxy
Expand Down
9 changes: 9 additions & 0 deletions micro/lib/micro/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def self.randomize_passwords(properties)
randomize_password(properties, 'cc', 'password', 64)
randomize_password(properties, 'cc', 'staging_upload_user', 8)
randomize_password(properties, 'cc', 'staging_upload_password', 9)
randomize_password(properties, 'ccng', 'bulk_api_password', 64)
randomize_password(properties, 'ccng', 'staging_upload_user', 8)
randomize_password(properties, 'ccng', 'staging_upload_password', 9)
randomize_password(properties, 'router', 'password', 8)
router = properties['router']
randomize_password(router, 'status', 'user', 8)
Expand All @@ -32,16 +35,22 @@ def self.randomize_passwords(properties)
ccdb_password = secret(8)
properties['ccdb']['roles'].find {
|role| role['tag'] == 'admin' }['password'] = ccdb_password
properties['ccdb_ng']['roles'].find {
|role| role['tag'] == 'admin' }['password'] = ccdb_password

acmdb_password = secret(8)
properties['ccdb']['roles'].find {
|role| role['tag'] == 'acm' }['password'] = acmdb_password
properties['ccdb_ng']['roles'].find {
|role| role['tag'] == 'acm' }['password'] = acmdb_password
properties['acmdb']['roles'].find {
|role| role['tag'] == 'admin' }['password'] = acmdb_password

uaadb_password = secret(8)
properties['ccdb']['roles'].find {
|role| role['tag'] == 'uaa' }['password'] = uaadb_password
properties['ccdb_ng']['roles'].find {
|role| role['tag'] == 'uaa' }['password'] = uaadb_password
properties['uaadb']['roles'].find {
|role| role['tag'] == 'admin' }['password'] = uaadb_password

Expand Down
5 changes: 5 additions & 0 deletions micro/spec/micro/apply_spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
{ 'tag' => 'uaa' },
]
}

as.properties['ccdb_ng'] = as.properties['ccdb'].dup

as.properties['acmdb'] = {
'roles' => [
{ 'tag' => 'admin' },
Expand Down Expand Up @@ -79,6 +82,8 @@
{ 'tag' => 'uaa' },
]
}
as.properties['ccdb_ng'] = as.properties['ccdb'].dup

as.properties['acmdb'] = {
'roles' => [
{ 'tag' => 'admin' },
Expand Down
6 changes: 6 additions & 0 deletions micro/spec/micro/settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
{ 'tag' => 'admin' },
{ 'tag' => 'uaa' },
] },
'ccdb_ng' => {
'roles' => [
{ 'tag' => 'acm' },
{ 'tag' => 'admin' },
{ 'tag' => 'uaa' },
] },
'acmdb' => {
'roles' => [
{ 'tag' => 'admin' },
Expand Down

0 comments on commit 9fb7b90

Please sign in to comment.