Skip to content
Merged
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
35 changes: 30 additions & 5 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,22 @@ jobs:
--admin-user admin --admin-pass admin
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ config:system:set overwrite.cli.url --value http://127.0.0.1 --type=string
./occ app:enable --force app_api

- name: Create HaRP container
run: |
docker run \
-e HP_SHARED_KEY="some_very_secure_password" \
-e NC_INSTANCE_URL="http://127.0.0.1" \
-e HP_LOG_LEVEL="debug" \
-v /var/run/docker.sock:/var/run/docker.sock \
--net host --name appapi-harp \
-d ghcr.io/nextcloud/nextcloud-appapi-harp:latest
docker run --net host --name nextcloud --rm \
-v "$(pwd)/apps/app_api/tests/simple-nginx-NOT-FOR-PRODUCTION.conf:/etc/nginx/conf.d/default.conf:ro" \
-d nginx

- name: Build image
run: |
IMAGE="$(php -r '$d = simplexml_load_file($argv[1])->{"external-app"}->{"docker-install"}; echo $d->registry . "/" . $d->image . ":" . $d->{"image-tag"};' apps/${{ env.APP_NAME }}/appinfo/info.xml)"
Expand All @@ -88,11 +102,13 @@ jobs:
- name: Test deploy
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:daemon:register harp_proxy "HaRP Proxy" docker-install http 127.0.0.1:8780 http://127.0.0.1 \
--harp --harp_frp_address 127.0.0.1:8782 --harp_shared_key "some_very_secure_password" --net host
# Deploy the image built above instead of pulling the published one
./occ app_api:daemon:registry:add docker_local_sock --registry-from ghcr.io --registry-to local
./occ app_api:app:register ${{ env.APP_NAME }} docker_local_sock \
--info-xml apps/${{ env.APP_NAME }}/appinfo/info.xml
./occ app_api:daemon:registry:add harp_proxy --registry-from ghcr.io --registry-to local
./occ app_api:app:register ${{ env.APP_NAME }} harp_proxy \
--info-xml apps/${{ env.APP_NAME }}/appinfo/info.xml --wait-finish
./occ app_api:app:disable ${{ env.APP_NAME }}
./occ app_api:app:enable ${{ env.APP_NAME }}
./occ app_api:app:disable ${{ env.APP_NAME }}

Expand All @@ -101,6 +117,7 @@ jobs:
run: |
docker inspect nc_app_${{ env.APP_NAME }} | json_pp > container.json
docker logs nc_app_${{ env.APP_NAME }} > container.log 2>&1
docker logs appapi-harp > harp.log 2>&1

- name: Check logs
run: |
Expand All @@ -112,7 +129,7 @@ jobs:
- name: Unregister App & Daemon
run: |
./occ app_api:app:unregister ${{ env.APP_NAME }}
./occ app_api:daemon:unregister docker_local_sock
./occ app_api:daemon:unregister harp_proxy

- name: Upload Container info
if: always()
Expand All @@ -130,6 +147,14 @@ jobs:
path: container.log
if-no-files-found: warn

- name: Upload HaRP logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_host_app_docker_harp.log
path: harp.log
if-no-files-found: warn

- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
Expand Down
Loading