plone / volto-addon-ci

1 stars 2 forks source link

Testing Volto Add-ons Docker Image

Docker Cloud Build Status

Docker Image optimized for running tests over Volto Add-ons

Supported tags and respective Dockerfile links

Base docker image

Source code

Simple Usage

$ docker run -it --rm \
             -e GIT_NAME=volto-group-block \
             -e GIT_BRANCH=develop \
             -e NAMESPACE=@eeacms \
             -e DEPENDENCIES="@eeacms/volto-blocks-form" \
         plone/volto-addon-ci eslint

Advanced Usage

$ docker run -it --rm \
             -e GIT_NAME=volto-group-block \
             -e GIT_CHANGE_ID=50 \
             -e GIT_BRANCH=PR-50 \
             -e NAMESPACE=@eeacms \
             -e DEPENDENCIES="@eeacms/volto-blocks-form" \
         plone/volto-addon-ci eslint

Local usage

$ cd src/addons/volto-slate

$ docker run -it --rm \
             -v $(pwd):/opt/frontend/my-volto-project/src/addons/volto-slate \
             -e GIT_NAME=volto-slate \
         plone/volto-addon-ci

Resolutions

Volto add-ons may depend on other JS libraries and/or other Volto add-ons. In order to enforce specific versions, you can use selective dependency resolutions within your add-on.

Troubleshooting

  1. Make sure your Volto project yarn.lock is not polluted. You can always reset your Volto project yarn.lock with:

    $ npm install -g @plone/generator-volto
    $ cd my-volto-project
    $ yo @plone/volto --skip-install --no-interactive /tmp/new-volto-project
    $ cp /tmp/new-volto-project/yarn.lock .
    $ yarn
  2. Add-on resolutions don't work with workspaces (development mode), thus you'll need to define resolutions within Volto project. To tackle this issue, this Docker image automatically extracts resolutions from add-on and add them also to the Volto project before running tests.

  3. See also

Supported environment variables

Supported commands

Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA). All Rights Reserved.

The Original Code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Funding

European Environment Agency (EU)