run.sh 622 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. set -eo pipefail
  3. dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
  4. serverImage="$1"
  5. dbName="test-$RANDOM-db"
  6. # Create an instance of the container-under-test
  7. cid="$(docker run -d \
  8. -e SQLITE_DATABASE="$dbName" \
  9. -e NEXTCLOUD_ADMIN_USER="test-$RANDOM-user" \
  10. -e NEXTCLOUD_ADMIN_PASSWORD="test-$RANDOM-password" \
  11. "$serverImage")"
  12. trap "docker rm -vf $cid > /dev/null" EXIT
  13. _occ() {
  14. docker exec -u www-data $cid php occ $1
  15. }
  16. # Give some time to install
  17. . "$dir/../../retry.sh" --tries 30 '_occ app:list' > /dev/null
  18. # Check if NextCloud is installed
  19. _occ status | grep -iq "installed: true"
  20. _occ check