public function onInstallReleaseCreateOrUpdateConfiguration(InstallReleaseEvent $event, $eventName, EventDispatcherInterface $eventDispatcher)
    {
        $release = $event->getRelease();
        $this->gatherEnvironmentVariables($release);

        $connection = $this->ensureConnection($release->getWorkspace()->getHost());

        $configurationFile = $release->getPath().$this->configurationFile;
        $configurationDistributionFile = $configurationFile.'.dist';

        $context = array('action' => 'Creating', 'configurationFile' => $configurationFile, 'event.task.action' => TaskInterface::ACTION_IN_PROGRESS);
        if ($connection->isFile($configurationFile)) {
            $context['action'] = 'Updating';
        }

        $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, '{action} configuration file "{configurationFile}"...', $eventName, $this, $context));

        $yamlConfiguration = $this->getYamlConfiguration($connection, $release->getWorkspace()->getHost()->getStage(), $configurationFile, $configurationDistributionFile);
        if ($connection->putContents($configurationFile, $yamlConfiguration)) {
            $context['event.task.action'] = TaskInterface::ACTION_COMPLETED;
            if ($context['action'] === 'Creating') {
                $context['action'] = 'Created';
            } else {
                $context['action'] = 'Updated';
            }

            $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::NOTICE, '{action} configuration file "{configurationFile}".', $eventName, $this, $context));
        } else {
            $context['event.task.action'] = TaskInterface::ACTION_FAILED;
            $context['action'] = strtolower($context['action']);

            $eventDispatcher->dispatch(AccompliEvents::LOG, new LogEvent(LogLevel::WARNING, 'Failed {action} configuration file "{configurationFile}".', $eventName, $this, $context));
        }
    }