Skip to content

Commit

Permalink
Merge pull request #14687 from jameswnl/repo-status
Browse files Browse the repository at this point in the history
Pickup Tower Project's repo-sync status
(cherry picked from commit 84006ef)
  • Loading branch information
Fryguy authored and simaishi committed Apr 11, 2017
1 parent 54ffffa commit 8479214
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Expand Up @@ -60,6 +60,7 @@ def configuration_script_sources
inventory_object.scm_clean = project.scm_clean
inventory_object.scm_delete_on_update = project.scm_delete_on_update
inventory_object.scm_update_on_launch = project.scm_update_on_launch
inventory_object.status = project.status

project.playbooks.each do |playbook_name|
inventory_object_playbook = persister.configuration_script_payloads.find_or_build_by(
Expand Down
5 changes: 4 additions & 1 deletion app/models/manager_refresh/inventory/core.rb
Expand Up @@ -26,7 +26,10 @@ def has_configuration_script_sources(options = {})
has_inventory({
:model_class => ::ConfigurationScriptSource,
:manager_ref => [:manager_ref],
:inventory_object_attributes => %i(name description scm_type scm_url scm_branch scm_clean scm_delete_on_update scm_update_on_launch authentication),
:inventory_object_attributes => %i(
name description scm_type scm_url scm_branch scm_clean scm_delete_on_update
scm_update_on_launch authentication status
),
}.merge(options))
end

Expand Down
@@ -0,0 +1,5 @@
class AddStatusToConfigurationScriptSource < ActiveRecord::Migration[5.0]
def change
add_column :configuration_script_sources, :status, :string
end
end
1 change: 1 addition & 0 deletions db/schema.yml
Expand Up @@ -553,6 +553,7 @@ configuration_script_sources:
- scm_update_on_launch
- authentication_id
- type
- status
configuration_scripts:
- id
- manager_id
Expand Down
3 changes: 2 additions & 1 deletion spec/support/ansible_shared/automation_manager/refresher.rb
Expand Up @@ -133,7 +133,8 @@ def assert_configuration_script_sources
:scm_branch => 'master',
:scm_clean => false,
:scm_delete_on_update => false,
:scm_update_on_launch => true
:scm_update_on_launch => true,
:status => 'successful'
)
expect(expected_configuration_script_source.authentication.name).to eq('db-github')
end
Expand Down

0 comments on commit 8479214

Please sign in to comment.