AC-132 Minor updates after testing via API, notes on remaining items to implement.

This commit is contained in:
Chris Church 2013-08-26 10:29:46 -04:00
parent ee3ba2c0e1
commit e661f96054
4 changed files with 14 additions and 9 deletions

View File

@ -603,6 +603,15 @@ class Project(CommonModel):
default=False,
editable=False,
)
# FIXME: Still need to implement:
# - some scm_url validation
# - scm_update_on_launch
# - prompt for passwords for project update
# - prompt for passwords when running job when scm_update_on_launch set
# - prevent simultaneous updates of project and running jobs using project
# - prevent manually setting local path when scm_type is set
# - masking passwords in project update args/stdout
def save(self, *args, **kwargs):
# Check if scm_type or scm_url changes.

View File

@ -371,14 +371,10 @@ class RunProjectUpdate(BaseTask):
args.append('project_update.yml')
ssh_key_path = kwargs.get('ssh_key_path', '')
subcmds = [
('ssh-add', '-D'),
args,
]
if ssh_key_path:
subcmds.insert(1, ('ssh-add', ssh_key_path))
cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds])
args = ['ssh-agent', 'sh', '-c', cmd]
subcmds = [('ssh-add', ssh_key_path), args]
cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds])
args = ['ssh-agent', 'sh', '-c', cmd]
return args
def build_cwd(self, project_update, **kwargs):

View File

@ -37,7 +37,7 @@ project_urls = patterns('awx.main.views',
url(r'^(?P<pk>[0-9]+)/organizations/$', 'project_organizations_list'),
url(r'^(?P<pk>[0-9]+)/teams/$', 'project_teams_list'),
url(r'^(?P<pk>[0-9]+)/update/$', 'project_update_view'),
url(r'^(?P<pk>[0-9]+)/updates/$', 'project_updates_list'),
url(r'^(?P<pk>[0-9]+)/project_updates/$', 'project_updates_list'),
)
project_update_urls = patterns('awx.main.views',

View File

@ -15,7 +15,7 @@
- name: delete project directory before update
file: path={{project_path}} state=absent
when: scm_delete_on_update
when: scm_delete_on_update|default('')
- name: update project using git
git: dest={{project_path}} repo={{scm_url}} version={{scm_branch}} force={{scm_clean}}