mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
AC-132 Minor updates after testing via API, notes on remaining items to implement.
This commit is contained in:
@@ -604,6 +604,15 @@ class Project(CommonModel):
|
|||||||
editable=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):
|
def save(self, *args, **kwargs):
|
||||||
# Check if scm_type or scm_url changes.
|
# Check if scm_type or scm_url changes.
|
||||||
if self.pk:
|
if self.pk:
|
||||||
|
|||||||
@@ -371,14 +371,10 @@ class RunProjectUpdate(BaseTask):
|
|||||||
args.append('project_update.yml')
|
args.append('project_update.yml')
|
||||||
|
|
||||||
ssh_key_path = kwargs.get('ssh_key_path', '')
|
ssh_key_path = kwargs.get('ssh_key_path', '')
|
||||||
subcmds = [
|
|
||||||
('ssh-add', '-D'),
|
|
||||||
args,
|
|
||||||
]
|
|
||||||
if ssh_key_path:
|
if ssh_key_path:
|
||||||
subcmds.insert(1, ('ssh-add', ssh_key_path))
|
subcmds = [('ssh-add', ssh_key_path), args]
|
||||||
cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds])
|
cmd = ' && '.join([subprocess.list2cmdline(x) for x in subcmds])
|
||||||
args = ['ssh-agent', 'sh', '-c', cmd]
|
args = ['ssh-agent', 'sh', '-c', cmd]
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def build_cwd(self, project_update, **kwargs):
|
def build_cwd(self, project_update, **kwargs):
|
||||||
|
|||||||
@@ -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]+)/organizations/$', 'project_organizations_list'),
|
||||||
url(r'^(?P<pk>[0-9]+)/teams/$', 'project_teams_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]+)/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',
|
project_update_urls = patterns('awx.main.views',
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
- name: delete project directory before update
|
- name: delete project directory before update
|
||||||
file: path={{project_path}} state=absent
|
file: path={{project_path}} state=absent
|
||||||
when: scm_delete_on_update
|
when: scm_delete_on_update|default('')
|
||||||
|
|
||||||
- name: update project using git
|
- name: update project using git
|
||||||
git: dest={{project_path}} repo={{scm_url}} version={{scm_branch}} force={{scm_clean}}
|
git: dest={{project_path}} repo={{scm_url}} version={{scm_branch}} force={{scm_clean}}
|
||||||
|
|||||||
Reference in New Issue
Block a user