Skip to content

Commit

Permalink
Add SCM options and SCMCredential to Ansible Tower Automation Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswnl committed Feb 15, 2017
1 parent 82b0db1 commit 3541b75
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 21 deletions.
2 changes: 2 additions & 0 deletions app/models/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def self.new(*args, &block)
has_many :configuration_script_bases,
:through => :authentication_configuration_script_bases

has_many :configuration_script_sources

before_save :set_credentials_changed_on
after_save :after_authentication_changed

Expand Down
1 change: 1 addition & 0 deletions app/models/configuration_script_source.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class ConfigurationScriptSource < ApplicationRecord
has_many :configuration_script_payloads
belongs_to :authentication
belongs_to :manager, :class_name => "ExtManagementSystem"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class ManageIQ::Providers::AnsibleTower::AutomationManager::ScmCredential < ManageIQ::Providers::AutomationManager::Authentication
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AddScmAttributesToConfigurationScriptSource < ActiveRecord::Migration[5.0]
def change
add_column :configuration_script_sources, :scm_type, :string
add_column :configuration_script_sources, :scm_url, :string
add_column :configuration_script_sources, :scm_branch, :string
add_column :configuration_script_sources, :scm_clean, :boolean
add_column :configuration_script_sources, :scm_delete_on_update, :boolean
add_column :configuration_script_sources, :scm_update_on_launch, :boolean
add_column :configuration_script_sources, :authentication_id, :bigint
end
end
7 changes: 7 additions & 0 deletions db/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,13 @@ configuration_script_sources:
- description
- created_at
- updated_at
- scm_type
- scm_url
- scm_branch
- scm_clean
- scm_delete_on_update
- scm_update_on_launch
- authentication_id
configuration_scripts:
- id
- manager_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module MiqAeMethodService
class MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_ScmCredential < MiqAeServiceManageIQ_Providers_AutomationManager_Authentication
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe MiqAeMethodService::MiqAeServiceManageIQ_Providers_AnsibleTower_AutomationManager_ScmCredential do
it "get the service model class" do
expect { described_class }.not_to raise_error
end
end
21 changes: 0 additions & 21 deletions spec/models/configuration_script_source_spec.rb

This file was deleted.

0 comments on commit 3541b75

Please sign in to comment.