Skip to content

Collection of utilities for interacting with Lagoon

Notifications You must be signed in to change notification settings

salsadigitalauorg/lagoon_ansible_collection

Repository files navigation

Ansible Collection - lagoon

tests

This repository contains collections related to the Lagoon application delivery platform.

The following collections are available:

Update graphql schema

This uses the Lagoon CLI to acquire an updated token, then uses the gql-cli to download the schema.

# Install requirements.
python3 -m pip install -r api/requirements.txt

# Ensure a fresh token is available.
lagoon -l amazeeio whoami
export LAGOON_TOKEN=$(yq -r '.lagoons.amazeeio.token' ~/.lagoon.yml)

# Download the schema.
gql-cli https://api.lagoon.amazeeio.cloud/graphql --print-schema \
    --header Authorization:"Bearer $LAGOON_TOKEN" > api/tests/common/schema.graphql

Run unit tests

docker compose build test
docker compose run --rm test units -v --requirements

Creating the docs

To view the module docs in the terminal, run

# List modules
docker compose run --rm --entrypoint="" -T lint-docs bash -c \
  'ansible-doc -t module lagoon.api -l'

# Specific module (group)
docker compose run --rm --entrypoint="" -T lint-docs bash -c \
  'ansible-doc -t module lagoon.api.group'

Linting the docs

docker compose run --rm lint-docs

Build & serve the docs:

docker compose up -d docs

Docs should be ready to browse at http://localhost:9180.