forked from nextcloud/neon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-dev-instance.sh
executable file
·29 lines (27 loc) · 968 Bytes
/
run-dev-instance.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$0")/.."
username="test"
password="supersafepasswordtocircumventpasswordpolicies"
ip=""
if [ "$#" -ne 1 ]; then
echo "You need to give the platform type: localhost, android-emulator"
exit 1
elif [[ "$1" == "android-emulator" ]]; then
ip="10.0.2.2"
elif [[ "$1" == "localhost" ]]; then
ip="localhost"
else
echo "Unknown platform type: $1"
exit 1
fi
docker build -t nextcloud-harbour-dev --build-arg "username=$username" --build-arg "password=$password" -f - ./packages/nextcloud/test < tool/Dockerfile.dev
echo "TEST_HOST=http://$ip:80
TEST_USER=$username
TEST_PASSWORD=$password" > packages/harbour/assets/.env
function cleanup() {
rm packages/harbour/assets/.env
}
trap cleanup EXIT
# The multiple ports are used to let the app think we are talking to two different servers when in fact it's only one
docker run --rm -v nextcloud-harbour-dev:/usr/src/nextcloud -p "80:80" -p "81:80" nextcloud-harbour-dev