Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed "cloud-py-api" to "nextcloud" for "app-skeleton-python" and "test-deploy" #420

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions .github/workflows/tests-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,25 @@ jobs:
run: |
PHP_CLI_SERVER_WORKERS=2 php -S 127.0.0.1:8080 &
./occ app_api:daemon:register docker_local_sock Docker docker-install http /var/run/docker.sock http://127.0.0.1:8080/index.php
./occ app_api:app:register skeleton docker_local_sock \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable skeleton
./occ app_api:app:disable skeleton
./occ app_api:app:register app-skeleton-python docker_local_sock \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable app-skeleton-python
./occ app_api:app:disable app-skeleton-python
- name: Check logs
run: |
grep -q 'Hello from skeleton :)' data/nextcloud.log || error
grep -q 'Bye bye from skeleton :(' data/nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' data/nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' data/nextcloud.log || error
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect nc_app_app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
./occ app_api:app:unregister skeleton
./occ app_api:app:unregister app-skeleton-python
./occ app_api:daemon:unregister docker_local_sock
- name: Test OCC commands(docker)
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
runs-on: ubuntu-22.04
name: NC In Julius Docker • 🐘8.3
env:
docker-image: ghcr.io/juliushaertl/nextcloud-dev-php83:master
docker-image: ghcr.io/juliusknorr/nextcloud-dev-php83:master

steps:
- name: Set app env
Expand All @@ -165,29 +165,29 @@ jobs:
docker_local_sock Docker docker-install http /var/run/docker.sock http://nextcloud/index.php \
--net=master_bridge
docker exec nextcloud sudo -u www-data php occ app_api:daemon:list
docker exec nextcloud sudo -u www-data php occ app_api:app:register skeleton docker_local_sock \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:disable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:register app-skeleton-python docker_local_sock \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:app:disable app-skeleton-python
- name: Copy NC log to host
if: always()
run: docker cp nextcloud:/var/www/html/data/nextcloud.log nextcloud.log

- name: Check logs
run: |
grep -q 'Hello from skeleton :)' nextcloud.log || error
grep -q 'Bye bye from skeleton :(' nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' nextcloud.log || error
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:daemon:unregister docker_local_sock
- name: Upload Container info
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
runs-on: ubuntu-22.04
name: NC In Julius Docker(DSP-HTTP) • 🐘8.3
env:
docker-image: ghcr.io/juliushaertl/nextcloud-dev-php83:master
docker-image: ghcr.io/juliusknorr/nextcloud-dev-php83:master

steps:
- name: Set app env
Expand All @@ -230,7 +230,7 @@ jobs:
docker run -v /var/run/docker.sock:/var/run/docker.sock \
-e NC_HAPROXY_PASSWORD="some_secure_password" \
--net master_bridge --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \
--privileged -d ghcr.io/cloud-py-api/nextcloud-appapi-dsp:latest
--privileged -d ghcr.io/nextcloud/nextcloud-appapi-dsp:latest
docker run --net master_bridge --name nextcloud --rm -d ${{ env.docker-image }}
sleep 60s
Expand All @@ -244,29 +244,29 @@ jobs:
docker_by_port Docker docker-install http nextcloud-appapi-dsp:2375 http://nextcloud/index.php \
--net=master_bridge --haproxy_password=some_secure_password
docker exec nextcloud sudo -u www-data php occ app_api:daemon:list
docker exec nextcloud sudo -u www-data php occ app_api:app:register skeleton docker_by_port \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:disable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:register app-skeleton-python docker_by_port \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:app:disable app-skeleton-python
- name: Copy NC log to host
if: always()
run: docker cp nextcloud:/var/www/html/data/nextcloud.log nextcloud.log

- name: Check logs
run: |
grep -q 'Hello from skeleton :)' nextcloud.log || error
grep -q 'Bye bye from skeleton :(' nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' nextcloud.log || error
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect nc_app_app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:daemon:unregister docker_by_port
- name: Upload Container info
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
runs-on: ubuntu-22.04
name: NC In Julius Docker(DSP-HTTPS) • 🐘8.3
env:
docker-image: ghcr.io/juliushaertl/nextcloud-dev-php83:master
docker-image: ghcr.io/juliusknorr/nextcloud-dev-php83:master

steps:
- name: Set app env
Expand All @@ -317,7 +317,7 @@ jobs:
-e BIND_ADDRESS="172.17.0.1" \
-e EX_APPS_NET="ipv4@localhost" \
--net host --name nextcloud-appapi-dsp -h nextcloud-appapi-dsp \
--privileged -d ghcr.io/cloud-py-api/nextcloud-appapi-dsp:latest
--privileged -d ghcr.io/nextcloud/nextcloud-appapi-dsp:latest
docker run --net=bridge --name=nextcloud -p 8080:80 --rm -d ${{ env.docker-image }}
sleep 60s
hostname -I
Expand All @@ -335,19 +335,19 @@ jobs:
docker_by_port Docker docker-install https host.docker.internal:2375 http://localhost:8080/index.php \
--net=host --haproxy_password=some_secure_password
docker exec nextcloud sudo -u www-data php occ app_api:daemon:list
docker exec nextcloud sudo -u www-data php occ app_api:app:register skeleton docker_by_port \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:disable skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:register app-skeleton-python docker_by_port \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
docker exec nextcloud sudo -u www-data php occ app_api:app:enable app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:app:disable app-skeleton-python
- name: Copy NC log to host
if: always()
run: docker cp nextcloud:/var/www/html/data/nextcloud.log nextcloud.log

- name: Check logs
run: |
grep -q 'Hello from skeleton :)' nextcloud.log || error
grep -q 'Bye bye from skeleton :(' nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' nextcloud.log || error
- name: Save HaProxy logs
if: always()
Expand All @@ -356,12 +356,12 @@ jobs:
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect nc_app_app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister skeleton
docker exec nextcloud sudo -u www-data php occ app_api:app:unregister app-skeleton-python
docker exec nextcloud sudo -u www-data php occ app_api:daemon:unregister docker_by_port
- name: Upload HaProxy logs
Expand Down Expand Up @@ -484,25 +484,25 @@ jobs:
PHP_CLI_SERVER_WORKERS=2 php -S 127.0.0.1:8080 &
./occ app_api:daemon:register docker_local_sock Docker docker-install http /var/run/docker.sock http://127.0.0.1:8080/index.php
./occ app_api:daemon:list
./occ app_api:app:register skeleton docker_local_sock \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable skeleton
./occ app_api:app:disable skeleton
./occ app_api:app:register app-skeleton-python docker_local_sock \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable app-skeleton-python
./occ app_api:app:disable app-skeleton-python
- name: Check logs
run: |
grep -q 'Hello from skeleton :)' data/nextcloud.log || error
grep -q 'Bye bye from skeleton :(' data/nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' data/nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' data/nextcloud.log || error
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect nc_app_app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
./occ app_api:app:unregister skeleton
./occ app_api:app:unregister app-skeleton-python
./occ app_api:daemon:unregister docker_local_sock
- name: Test OCC commands(docker)
Expand Down Expand Up @@ -608,25 +608,25 @@ jobs:
docker_socket_local Docker docker-install http /var/run/docker.sock http://127.0.0.1:8080/index.php \
--net=host --set-default
./occ app_api:daemon:list
./occ app_api:app:register skeleton \
--info-xml https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable skeleton
./occ app_api:app:disable skeleton
./occ app_api:app:register app-skeleton-python \
--info-xml https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml
./occ app_api:app:enable app-skeleton-python
./occ app_api:app:disable app-skeleton-python
- name: Check logs
run: |
grep -q 'Hello from skeleton :)' data/nextcloud.log || error
grep -q 'Bye bye from skeleton :(' data/nextcloud.log || error
grep -q 'Hello from app-skeleton-python :)' data/nextcloud.log || error
grep -q 'Bye bye from app-skeleton-python :(' data/nextcloud.log || error
- name: Save container info & logs
if: always()
run: |
docker inspect nc_app_skeleton | json_pp > container.json
docker logs nc_app_skeleton > container.log 2>&1
docker inspect nc_app_app-skeleton-python | json_pp > container.json
docker logs nc_app_app-skeleton-python > container.log 2>&1
- name: Unregister Skeleton & Daemon
run: |
./occ app_api:app:unregister skeleton
./occ app_api:app:unregister app-skeleton-python
./occ app_api:daemon:unregister docker_socket_local
- name: Test OCC commands(docker)
Expand Down
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
class Application extends App implements IBootstrap {
public const APP_ID = 'app_api';
public const TEST_DEPLOY_APPID = 'test-deploy';
public const TEST_DEPLOY_INFO_XML = 'https://raw.githubusercontent.com/cloud-py-api/test-deploy/main/appinfo/info.xml';
public const TEST_DEPLOY_INFO_XML = 'https://raw.githubusercontent.com/nextcloud/test-deploy/main/appinfo/info.xml';

public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
Expand Down
26 changes: 13 additions & 13 deletions tests/test_occ_commands_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


SKELETON_XML_URL = (
"https://raw.githubusercontent.com/cloud-py-api/app-skeleton-python/main/appinfo/info.xml"
"https://raw.githubusercontent.com/nextcloud/app-skeleton-python/main/appinfo/info.xml"
)


Expand All @@ -27,13 +27,13 @@ def unregister_daemon():

def deploy_register():
run(
f"php occ app_api:app:deploy skeleton docker_local_sock --info-xml {SKELETON_XML_URL}".split(),
f"php occ app_api:app:deploy app-skeleton-python docker_local_sock --info-xml {SKELETON_XML_URL}".split(),
stderr=DEVNULL,
stdout=DEVNULL,
check=True,
)
run(
f"php occ app_api:app:register skeleton docker_local_sock --info-xml {SKELETON_XML_URL}".split(),
f"php occ app_api:app:register app-skeleton-python docker_local_sock --info-xml {SKELETON_XML_URL}".split(),
stderr=DEVNULL,
stdout=DEVNULL,
check=True,
Expand All @@ -57,29 +57,29 @@ def deploy_register():
assert r_output.find("http://127.0.0.1:8080/index.php/") == -1
assert r_output.find("http://127.0.0.1:8080/index.php") != -1
# silent should not fail, as there are not such ExApp
r = run("php occ --no-warnings app_api:app:unregister skeleton --silent".split(), stdout=PIPE, stderr=PIPE, check=True)
r = run("php occ --no-warnings app_api:app:unregister app-skeleton-python --silent".split(), stdout=PIPE, stderr=PIPE, check=True)
assert not r.stderr.decode("UTF-8")
r_output = r.stdout.decode("UTF-8")
assert not r_output, f"Output should be empty: {r_output}"
# without "--silent" it should fail, as there are not such ExApp
r = run("php occ --no-warnings app_api:app:unregister skeleton".split(), stdout=PIPE)
r = run("php occ --no-warnings app_api:app:unregister app-skeleton-python".split(), stdout=PIPE)
assert r.returncode
assert r.stdout.decode("UTF-8"), "Output should be non empty"
# testing if volume is kept by default
deploy_register()
r = run("php occ --no-warnings app_api:app:unregister skeleton".split(), stdout=PIPE, check=True)
r = run("php occ --no-warnings app_api:app:unregister app-skeleton-python".split(), stdout=PIPE, check=True)
assert r.stdout.decode("UTF-8"), "Output should be non empty"
run("docker volume inspect nc_app_skeleton_data".split(), check=True)
run("docker volume inspect nc_app_app-skeleton-python_data".split(), check=True)
# test if volume will be removed with "--rm-data"
deploy_register()
run("php occ --no-warnings app_api:app:unregister skeleton --rm-data".split(), check=True)
r = run("docker volume inspect nc_app_skeleton_data".split())
run("php occ --no-warnings app_api:app:unregister app-skeleton-python --rm-data".split(), check=True)
r = run("docker volume inspect nc_app_app-skeleton-python_data".split())
assert r.returncode
# test "--force" option
deploy_register()
run("docker container rm --force nc_app_skeleton".split(), check=True)
r = run("php occ --no-warnings app_api:app:unregister skeleton".split())
run("docker container rm --force nc_app_app-skeleton-python".split(), check=True)
r = run("php occ --no-warnings app_api:app:unregister app-skeleton-python".split())
assert r.returncode
r = run("php occ --no-warnings app_api:app:unregister skeleton --silent".split())
r = run("php occ --no-warnings app_api:app:unregister app-skeleton-python --silent".split())
assert r.returncode
run("php occ --no-warnings app_api:app:unregister skeleton --force".split(), check=True)
run("php occ --no-warnings app_api:app:unregister app-skeleton-python --force".split(), check=True)
Loading