Skip to content

Commit

Permalink
tests actions update
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Jul 14, 2023
1 parent 290c96c commit 21011f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@ jobs:
run: |
php -S 127.0.0.1:8080 &
./occ app_ecosystem_v2:daemon:register docker_local_sock Docker docker-install unix-socket /var/run/docker.sock http://127.0.0.1:8080/index.php
/occ app_ecosystem_v2:app:deploy app_python_skeleton docker_local_sock \
./occ app_ecosystem_v2:app:deploy app_python_skeleton docker_local_sock \
--info-xml https://raw.githubusercontent.com/cloud-py-api/py_app_v2-skeleton/main/appinfo/info.xml
./occ app_ecosystem_v2:app:register app_python_skeleton docker_local_sock
./occ app_ecosystem_v2:app:enable app_python_skeleton
./occ app_ecosystem_v2:app:disable app_python_skeleton
./occ app_ecosystem_v2:app:unregister app_python_skeleton --silent
./occ app_ecosystem_v2:daemon:unregister docker_local_sock
- name: Check logs
run: |
Expand Down Expand Up @@ -164,6 +166,8 @@ jobs:
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:register app_python_skeleton docker_local_sock
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:enable app_python_skeleton
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:disable app_python_skeleton
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:unregister app_python_skeleton --silent
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_local_sock
- name: Copy NC log to host
run: docker cp nextcloud:/var/www/html/data/nextcloud.log nextcloud.log
Expand Down Expand Up @@ -240,6 +244,8 @@ jobs:
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:register app_python_skeleton docker_by_port
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:enable app_python_skeleton
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:disable app_python_skeleton
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:app:unregister app_python_skeleton --silent
docker exec nextcloud sudo -u www-data php occ app_ecosystem_v2:daemon:unregister docker_by_port
- name: Copy NC log to host
run: docker cp nextcloud:/var/www/html/data/nextcloud.log nextcloud.log
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
echo $! > /tmp/_install.pid
cd ..
sleep 5s
php occ app_ecosystem_v2:daemon:register simulate_docker Docker docker-install unix-socket 0 0
php occ app_ecosystem_v2:app:register \
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"simulate_docker\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"port\":$APP_PORT,\"system_app\":1}" \
php occ app_ecosystem_v2:daemon:register manual_install "Manual Install" manual-install 0 0 0
php occ app_ecosystem_v2:app:register nc_py_api manual_install --json-info \
"{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"simulate_docker\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"host\":\"localhost\",\"port\":$APP_PORT,\"protocol\":\"http\",\"system_app\":1}" \
-e --force-scopes
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExApp/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function configure() {

$this->addOption('enabled', 'e', InputOption::VALUE_NONE, 'Enable ExApp after registration');
$this->addOption('force-scopes', null, InputOption::VALUE_NONE, 'Force scopes approval');
$this->addOption('json-info', null, InputOption::VALUE_REQUIRED, 'ExApp JSON deploy info (url or absolute local path)');
$this->addOption('json-info', null, InputOption::VALUE_REQUIRED, 'ExApp JSON deploy info');
}

protected function execute(InputInterface $input, OutputInterface $output): int {
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

$exAppInfo = $this->manualActions->loadExAppInfo($appId, $daemonConfig, [
'ex_app_json' => $exAppJson,
'json-info' => $exAppJson,
]);
} else {
$output->writeln(sprintf('Daemon config %s actions for %s not found.', $daemonConfigName, $daemonConfig->getAcceptsDeployId()));
Expand Down
4 changes: 2 additions & 2 deletions lib/DeployActions/ManualActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function deployExApp(DaemonConfig $daemonConfig, array $params = []): mix
}

public function loadExAppInfo(string $appId, DaemonConfig $daemonConfig, array $params = []): array {
$jsonInfo = json_decode(file_get_contents($params['json-info']), true);
$jsonInfo = json_decode($params['json-info'], true);
return [
'appid' => $jsonInfo['appid'],
'version' => $jsonInfo['version'],
Expand All @@ -61,7 +61,7 @@ public function loadExAppInfo(string $appId, DaemonConfig $daemonConfig, array $
}

public function resolveDeployExAppHost(string $appId, DaemonConfig $daemonConfig, array $params = []): string {
$jsonInfo = json_decode(file_get_contents($params['json-info']), true);
$jsonInfo = json_decode($params['json-info'], true);
return $jsonInfo['host'];
}
}

0 comments on commit 21011f5

Please sign in to comment.