Skip to content

Commit

Permalink
Fixed Readme test link
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjol committed Nov 26, 2023
1 parent b6eab44 commit 0edf80d
Showing 1 changed file with 3 additions and 52 deletions.
55 changes: 3 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![tests](https://github.com/Metadrop/ddev-mkdocs/actions/workflows/tests.yml/badge.svg)](https://github.com/tadrop/ddev-mkdocs/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)
[![tests](https://github.com/Metadrop/ddev-mkdocs/actions/workflows/tests.yml/badge.svg)](https://github.com/Metadrop/ddev-mkdocs/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2024.svg)

## ddev-mkdocs

Expand Down Expand Up @@ -32,57 +32,8 @@ Also this addon uses ports 9004 and 9005 to view documentation, this can be upda

### Write your own documentation

To start building your docs you can read the [Mkdocs getting started guide](https://www.mkdocs.org/getting-started/) and for more advanced functionalities here is the [Mkdocs user guide](https://www.mkdocs.org/user-guide/)
To start building your docs you can read the [Mkdocs getting started guide](https://www.mkdocs.org/getting-started/) and for more advanced functionalities here is the [Mkdocs user guide](https://www.mkdocs.org/user-guide/).

### View the documentation

The backstop commands 'backstop remote' and 'backstop openReport' do not work in this setup.

But there is a host command that will open the latest test report in your default browser:

```shell
ddev backstop-results
```

Alternatively open the generated HTML-Report with your browser, e.g.:

```shell
open tests/backstop/backstop_data/_mytestproject_/html_report/index.html
```

## Changes to the original docker image

The backstopjs docker image is extended with some functions using a custom docker build, see [Dockerfile](backstopBuild/Dockerfile)
and uses a custom [entrypoint](backstopBuild/entrypoint.sh).

In the Dockerfile the following is added/changed:

- add the custom entrypoint.sh to the image
- delete the default 'node' user with uid 1000 and add current ddev user
- install the [minimist](https://www.npmjs.com/package/minimist) npm package globally. This is not needed by default
but very handy to parse command line args for more complex custom backstopjs configs.

The entrypoint is responsible for:

- add /etc/hosts entries for all hosts configured in the ddev web container automatically
- add sleep command to keep the container running

## Advanced

### How to add additional hostnames?

If you want to test hosts not configured in the web container, you need to use external_links in
[docker-compose.backstop.yaml](docker-compose.backstop.yaml).

See: [ddev FAQ: Can different projects communicate with each other?](https://ddev.readthedocs.io/en/latest/users/usage/faq/#features-requirements)

Do not forget to remove the #ddev-generated line!

### Change backstop tests directory
Per default the backstop directory containing backstop config etc. is expected in your project directory (besides the
.ddev folder) in the directory *tests/backstop*.

If you want to change that edit the file [docker-compose.backstop.yaml](docker-compose.backstop.yaml) and
change the line in volumes to the path you want to use, move the files to the new directory and restart ddev.

Make sure to remove the #ddev-generated line from the file to prevent ddev from making changes to it.
Mkdocs documentation can be accesed in https://${PROJECT_NAME}.ddev.site:9005

0 comments on commit 0edf80d

Please sign in to comment.