Skip to content

Commit

Permalink
docs: add information in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MaferMazu committed Aug 2, 2024
1 parent 77066d4 commit c544e98
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 4 deletions.
115 changes: 112 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
picasso plugin for `Tutor <https://docs.tutor.edly.io>`__
#########################################################
Picasso `Tutor`_ Plugin
#########################

picasso plugin for Tutor
|Maintainance Badge| |Test Badge|

.. |Maintainance Badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
:alt: Maintainance Status
.. |Test Badge| image:: https://img.shields.io/github/actions/workflow/status/edunext/tutor-contrib-picasso/.github%2Fworkflows%2Ftests.yml?label=Test
:alt: GitHub Actions Workflow Test Status

Picasso is a `Tutor`_ plugin that simplifies pre-build processes, such as preparing Docker images with private requirements, executing commands before the build, and adding themes. Everything is managed through commands, making it easy to integrate into automated environments.

This plugin is based on https://github.com/eduNEXT/tutor-contrib-edunext-distro


Installation
Expand All @@ -16,10 +25,110 @@ Usage

.. code-block:: bash
# To enable the plugin
tutor plugins enable picasso
# Show help
tutor picasso -h
# Enable themes
tutor picasso enable-themes
# Enable private packages
tutor picasso enable-private-packages
# Run Tutor commands
tutor picasso run-extra-commands
.. note::

Remember to run these commands before build your images if they are needed.


Compatibility notes
*******************

This plugin was tested from Palm release.

About the commands
*******************

Enable Private Packages
^^^^^^^^^^^^^^^^^^^^^^^^

This command allows the installation of private Open edX Django apps. It clones the private repository and, through the ``tutor mounts`` command, adds it to the Dockerfile for inclusion in the build process. The input it takes is:

.. code-block:: yaml
PICASSO_<YOUR_PACKAGE_NAME>_DPKG:
name: <your_package_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/package.git>
version: <your branch, tag o release for cloning. e.g., v5.2.0>
.. note::

It is needed to use the SSH URL to clone private packages.

.. warning::

For the mount to work correctly and include the package in the Dockerfile, it must be added to a tutor filter ``MOUNTED_DIRECTORIES``. By default, Picasso adds ``eox-*`` packages. If you need to add another private package, don't forget to include this configuration in a Tutor plugin.

.. code-block:: python
hooks.Filters.MOUNTED_DIRECTORIES.add_items(
[
("openedx", "<your_package_name>"),
]
)
.. note::

If you want to use public packages, we recommend using the ``OPEN_EDX_EXTRA_PIP_REQUIREMENTS`` variable in the ``config.yml`` of your Tutor environment.


Enable Themes
^^^^^^^^^^^^^^

This command clones your theme repository into the folder that Tutor uses for themes. Documentation available at `Installing custom theme`_ tutorial. The input it takes is:

.. code-block:: yaml
PICASSO_THEMES:
- name: <your_theme_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/theme.git>
version: <your branch, tag o release for cloning. e.g., edunext/redwood.master>
- name: <another_theme_name>
repo: <your SSH URL for cloning the repo. e.g., [email protected]:yourorg/another_theme.git>
version: <your branch, tag o release for cloning. e.g., edunext/redwood.blue>
.. note::

If your theme repository is public, you can also use the HTTPS URL in ``repo``.

.. note::

Don't forget to add extra configurations in a Tutor plugin if your theme requires it.


Run Extra Commands
^^^^^^^^^^^^^^^^^^^

This command allows you to run a list of Tutor commands. These commands are executed in bash and, for security reasons, are restricted to running only Tutor commands. The input it takes is:

.. code-block:: yaml
PICASSO_EXTRA_COMMANDS:
- <A tutor command. e.g., tutor plugins index add X>
- <A tutor command. e.g., tutor plugins install mfe>
- <A tutor command. e.g., tutor picasso enable-themes>
- <A tutor command. e.g., tutor config save>
.
.
.
License
*******

This software is licensed under the terms of the AGPLv3.


.. _Tutor: https://docs.tutor.edly.io
.. _Installing custom theme: https://docs.tutor.edly.io/tutorials/theming.html#theming
2 changes: 1 addition & 1 deletion tutorpicasso/commands/run_extra_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def validate_commands(commands: List[str]) -> None:
all the commands are correct before executing them
Args:
commands (list[str] | None): The commands sent through DISTRO_EXTRA_COMMANDS in config.yml
commands (list[str] | None): The commands sent through PICASSO_EXTRA_COMMANDS in config.yml
"""
splitted_commands = [
split_string(command, COMMAND_CHAINING_OPERATORS) for command in commands
Expand Down

0 comments on commit c544e98

Please sign in to comment.