Add Z to volume mount

Update to AWX execution environment
  use the special 2.9 container image
  revert setting back for merge

Fix another permission error by mapping 2 folders
  also create folders before running
This commit is contained in:
Alan Rominger 2020-08-24 16:02:11 -04:00 committed by Shane McDonald
parent 130bf076f4
commit a3f0158a94

View File

@ -2344,10 +2344,14 @@ class RunProjectUpdate(BaseTask):
# re-create root project folder if a natural disaster has destroyed it
if not os.path.exists(settings.PROJECTS_ROOT):
os.mkdir(settings.PROJECTS_ROOT)
project_path = instance.project.get_project_path(check_if_exists=False)
if not os.path.exists(project_path):
os.makedirs(project_path) # used as container mount
self.acquire_lock(instance)
self.original_branch = None
if instance.scm_type == 'git' and instance.branch_override:
project_path = instance.project.get_project_path(check_if_exists=False)
if os.path.exists(project_path):
git_repo = git.Repo(project_path)
if git_repo.head.is_detached:
@ -2499,12 +2503,14 @@ class RunProjectUpdate(BaseTask):
return getattr(settings, 'AWX_PROOT_ENABLED', False)
def build_execution_environment_params(self, instance):
project_path = os.path.dirname(instance.get_project_path(check_if_exists=False))
project_path = instance.get_project_path(check_if_exists=False)
cache_path = instance.get_cache_path()
execution_environment_params = {
"process_isolation": True,
"container_image": settings.AWX_EXECUTION_ENVIRONMENT_DEFAULT_IMAGE,
"container_volume_mounts": [
f"{project_path}:{project_path}:Z",
f"{cache_path}:{cache_path}:Z",
]
}