--- /dev/null
+FROM ubuntu:22.04
+
+# Install system depedancies
+ARG DEBIAN_FRONTEND=noninteractive
+RUN set -xe && \
+ apt-get update -yqq && \
+ apt-get install -yqq curl git mysql-client php8.1-cli php8.1-common php8.1-curl php8.1-mbstring \
+ php8.1-xml php8.1-zip php8.1-gd php8.1-bcmath php8.1-mysql php8.1-xdebug
+
+# Install composer to a custom location
+RUN mkdir /scripts && \
+ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
+
+CMD ["/bin/bash"]
\ No newline at end of file
--- /dev/null
+version: "3.8"
+
+services:
+ app:
+ build: .
+ volumes:
+ - ./:/cli
+ depends_on:
+ - db
+ db:
+ image: mysql:8.0
+ environment:
+ MYSQL_ROOT_PASSWORD: password
+ MYSQL_DATABASE: bookstack
+ MYSQL_USER: bookstack
+ MYSQL_PASSWORD: bookstack
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
+ bootstrap="vendor/autoload.php"
+ colors="true">
+ <testsuites>
+ <testsuite name="Tests">
+ <directory suffix="Test.php">./tests</directory>
+ </testsuite>
+ </testsuites>
+ <coverage processUncoveredFiles="true">
+ <include>
+ <directory suffix=".php">./app</directory>
+ </include>
+ </coverage>
+ <php>
+ <env name="APP_ENV" value="testing"/>
+ </php>
+</phpunit>
- **Update** - Update an existing BookStack installation to the latest version.
This CLI is intended to be platform abstract, intended for plain installs that follow our scripts/manual instructions.
-This is intended to work independently from BookStack itself, so it can be used even if a BookStack instance is not available or broken, although it could be distributed with and called upon by the core BookStack codebase.
+This is intended to work independently of BookStack itself, so it can be used even if a BookStack instance is not available or broken, although it could be distributed with and called upon by the core BookStack codebase.
### Development
php compile.php
```
+#### Docker Environment
+
+A docker-compose setup exists to create a clean, contained environment, which is important for this project since the
+CLI checks and interacts with many system-level elements.
+
+```bash
+# Enter the environment
+docker compose run -w /cli app
+
+# From there you'll be dropped into a bash shell within the project directory.
+# You could proceed to install dependencies via composer via:
+composer install
+
+# Then you can run tests via:
+vendor/bin/phpunit
+```
+
### Contributing
I welcome issues and PRs but keep in mind that I'd like to keep the feature-set narrow to limit support/maintenance burden.
-Therefore I likely won't leave issues open long, or merge PRs, for requests to add new features or for changes that increase the scope of what this script already supports.
\ No newline at end of file
+Therefore, I likely won't leave issues open long, or merge PRs, for requests to add new features or for changes that increase the scope of what this script already supports.
\ No newline at end of file