Skip to content

Commit 717ab83

Browse files
committed
Update cypress.yml
1 parent 7276f26 commit 717ab83

File tree

6 files changed

+108
-9
lines changed

6 files changed

+108
-9
lines changed

.github/workflows/cypress.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,15 @@ jobs:
4343
- name: Install dependencies & build app
4444
run: |
4545
npm ci
46-
TESTING=true npm run build --if-present
46+
npm run build --if-present
4747
4848
- name: Wait for server
49-
run: |
50-
npm install -g wait-on
51-
wait-on -i 500 -t 240000 $CYPRESS_baseUrl
49+
run: npm run wait-on $CYPRESS_baseUrl
5250

5351
- name: Enable app & configure server
5452
run: |
5553
cd cypress
56-
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} -T nextcloud bash /initserver.sh
54+
docker-compose exec --env APP_NAME=${{ env.APP_NAME }} --env BRANCH=${{ env.BRANCH }} -T nextcloud bash /initserver.sh
5755
5856
- name: Cypress run
5957
uses: cypress-io/github-action@v1

cypress/docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3'
1+
version: '3.7'
22

33
services:
44
nextcloud:
@@ -9,8 +9,10 @@ services:
99

1010
environment:
1111
CYPRESS_baseUrl: "http://127.0.0.1:8082/index.php"
12-
BRANCH: master
12+
BRANCH: "${BRANCH:-master}"
1313

1414
volumes:
15-
- ../:/var/www/html/apps/viewer
15+
# Using fallback to make sure this script doesn't mess
16+
# with the mounting if APP_NAME is not provided.
17+
- ../:/var/www/html/apps/${APP_NAME:-fallback}
1618
- ./initserver.sh:/initserver.sh

cypress/initserver.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

33
echo "APP_NAME: $APP_NAME"
4+
echo "BRANCH: $BRANCH"
5+
46
chown -R www-data:www-data /var/www/html/data
57

68
su www-data -c "

cypress/start.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
#!/usr/bin/env bash
22
# RUN THIS SCRIPT FROM THE ROOT FOLDER OF YOUR APP
33
APP_NAME=${PWD##*/}
4+
CYPRESS_baseUrl=http://127.0.0.1:8082/index.php
45

56
if [[ $APP_NAME == "cypress" ]]
67
then
78
echo "Please run this app from your app root folder."
89
else
910
echo "Launching docker server for the $APP_NAME app"
1011
cd cypress
11-
docker-compose up -d
12+
docker-compose pull
13+
docker-compose up -d --force-recreate
14+
npm run wait-on $CYPRESS_baseUrl
15+
echo "Nextcloud successfully installed"
1216
docker-compose exec --env APP_NAME=$APP_NAME -T nextcloud bash /initserver.sh
17+
echo "Nextcloud successfully configured"
1318
fi

package-lock.json

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"url-loader": "^4.1.1",
9797
"vue-loader": "^15.9.3",
9898
"vue-template-compiler": "^2.6.12",
99+
"wait-on": "^5.2.0",
99100
"webpack": "^4.44.2",
100101
"webpack-cli": "^3.3.12",
101102
"webpack-merge": "^5.2.0"

0 commit comments

Comments
 (0)