WordPress

  • Canonical IS DevOps
Channel Revision Published Runs on
latest/stable 87 07 Mar 2024
Ubuntu 22.04 Ubuntu 20.04
latest/stable 13 06 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
latest/edge 118 08 Oct 2024
Ubuntu 22.04 Ubuntu 20.04
latest/edge 15 30 Mar 2023
Ubuntu 22.04 Ubuntu 20.04
juju deploy wordpress-k8s
Show information

Platform:

How to contribute

Overview

This document explains the processes and practices recommended for contributing enhancements to the WordPress operator.

  • Generally, before developing enhancements to this charm, you should consider opening an issue explaining your use case.
  • If you would like to chat with us about your use-cases or proposed implementation, you can reach us at Canonical Mattermost public channel or Discourse.
  • Familiarising yourself with the Charmed Operator Framework library will help you a lot when working on new features or bug fixes.
  • All enhancements require review before being merged. Code review typically examines
    • code quality
    • test coverage
    • user experience for Juju operators of this charm.
  • Please help us out in ensuring easy to review branches by rebasing your pull request branch onto the main branch. This also avoids merge commits and creates a linear Git commit history.
  • For further information on contributing, please refer to our Contributing Guide

Developing

Building from source

To build and deploy wordpress-k8s charm from source follow the steps below.

Rockcraft image build and upload

Enable MicroK8S registry:

microk8s enable registry

The following commands import the images in the Docker daemon and push them into the registry:

cd [project_dir]/wordpress_rock && rockcraft pack
skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:wordpress_1.0_amd64.rock docker://localhost:32000/wordpress:latest

Build the charm

Build the charm locally using charmcraft. It should output a .charm file.

charmcraft pack

Deploy WordPress

Deploy the locally built WordPress charm with the following command.

juju deploy ./wordpress-k8s_ubuntu-22.04-amd64.charm \
  --resource wordpress-image=localhost:32000/wordpress:latest

You should now be able to see your local wordpress-k8s charm progress through the stages of the deployment through juju status --watch 2s.

Testing

The following commands can then be used to run the tests:

  • tox: Runs all of the basic checks (lint, unit, static, and coverage-report).
  • tox -e fmt: Runs formatting using black and isort.
  • tox -e lint: Runs a range of static code analysis to check the code.
  • tox -e static: Runs other checks such as bandit for security issues.
  • tox -e unit: Runs the unit tests.
  • tox -e integration: Runs the integration tests. Integration tests require additional arguments depending on the test module.

Canonical contributor agreement

Canonical welcomes contributions to the WordPress Operator. Please check out our contributor agreement if you’re interested in contributing to the solution.


Help improve this document in the forum (guidelines). Last updated 6 months ago.