Skip to content
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
8 changes: 3 additions & 5 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,15 @@ jobs:
- name: Install dependencies & build app
run: |
npm ci
TESTING=true npm run build --if-present
npm run build --if-present

- name: Wait for server
run: |
npm install -g wait-on
wait-on -i 500 -t 240000 $CYPRESS_baseUrl
run: npm run wait-on $CYPRESS_baseUrl

- name: Enable app & configure server
run: |
cd cypress
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} -T nextcloud bash /initserver.sh
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} --env BRANCH=${{ env.BRANCH }} -T nextcloud bash /initserver.sh

- name: Cypress run
uses: cypress-io/github-action@v1
Expand Down
8 changes: 5 additions & 3 deletions cypress/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3.7'

services:
nextcloud:
Expand All @@ -9,8 +9,10 @@ services:

environment:
CYPRESS_baseUrl: "http://127.0.0.1:8082/index.php"
BRANCH: master
BRANCH: "${BRANCH:-master}"

volumes:
- ../:/var/www/html/apps/viewer
# Using fallback to make sure this script doesn't mess
# with the mounting if APP_NAME is not provided.
- ../:/var/www/html/apps/${APP_NAME:-fallback}
- ./initserver.sh:/initserver.sh
2 changes: 2 additions & 0 deletions cypress/initserver.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

echo "APP_NAME: $APP_NAME"
echo "BRANCH: $BRANCH"

chown -R www-data:www-data /var/www/html/data

su www-data -c "
Expand Down
7 changes: 6 additions & 1 deletion cypress/start.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env bash
# RUN THIS SCRIPT FROM THE ROOT FOLDER OF YOUR APP
APP_NAME=${PWD##*/}
CYPRESS_baseUrl=http://127.0.0.1:8082/index.php

if [[ $APP_NAME == "cypress" ]]
then
echo "Please run this app from your app root folder."
else
echo "Launching docker server for the $APP_NAME app"
cd cypress
docker-compose up -d
docker-compose pull
docker-compose up -d --force-recreate
npm run wait-on $CYPRESS_baseUrl
echo "Nextcloud successfully installed"
docker-compose exec --env APP_NAME=$APP_NAME -T nextcloud bash /initserver.sh
echo "Nextcloud successfully configured"
fi
62 changes: 62 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"url-loader": "^4.1.0",
"vue-loader": "^15.9.3",
"vue-template-compiler": "^2.6.12",
"wait-on": "^5.2.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-merge": "^5.1.4"
Expand Down