Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub action and Docker image for asciidoc-linter #14

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rdmueller
Copy link
Member

@rdmueller rdmueller commented Mar 3, 2025

Related to #11

Add GitHub action and Docker image for AsciiDoc Linter.

  • Dockerfile

    • Create a Dockerfile to build a Docker image for the linter.
    • Use Python 3.9 as the base image.
    • Copy the project files into the Docker image.
    • Install the project dependencies.
    • Set the entry point to the linter CLI.
  • GitHub Action Workflow

    • Create a new GitHub action workflow file .github/workflows/asciidoc-linter-action.yml.
    • Use the Docker image to run the linter.
    • Trigger the action on push and pull request events to the main branch.
    • Define steps to build and run the Docker image.
  • README.adoc

    • Add instructions on how to use the linter as a GitHub action.
    • Add instructions on how to use the linter as a Docker image.

For more details, open the Copilot Workspace session.

rdmueller added 11 commits March 3, 2025 17:43
Related to #11

Add GitHub action and Docker image for AsciiDoc Linter.

* **Dockerfile**
  - Create a Dockerfile to build a Docker image for the linter.
  - Use Python 3.9 as the base image.
  - Copy the project files into the Docker image.
  - Install the project dependencies.
  - Set the entry point to the linter CLI.

* **GitHub Action Workflow**
  - Create a new GitHub action workflow file `.github/workflows/asciidoc-linter-action.yml`.
  - Use the Docker image to run the linter.
  - Trigger the action on push and pull request events to the main branch.
  - Define steps to build and run the Docker image.

* **README.adoc**
  - Add instructions on how to use the linter as a GitHub action.
  - Add instructions on how to use the linter as a Docker image.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/docToolchain/asciidoc-linter/issues/11?shareId=XXXX-XXXX-XXXX-XXXX).
* **Dockerfile**
  - Use Python 3.9 as the base image
  - Copy the project files into the Docker image
  - Install the project dependencies
  - Set the entry point to the linter CLI

* **GitHub Action**
  - Use the Docker image to run the linter
  - Trigger the action on pull requests and pushes to the main branch
  - Define the steps to build and run the Docker image

* **README.adoc**
  - Add instructions on how to use the linter as a GitHub action
  - Add instructions on how to use the linter as a Docker image
* Install asciidoc-linter as described in the README file
* Change the entry point to `asciidoc-linter` in the Dockerfile
* Add `RUN pip install pyyaml` to Dockerfile to install pyyaml in the Docker image
* Add `pip install pyyaml` to setup_test_environment.sh to install pyyaml in the test environment
* **Dockerfile**
  - Change entry point to `asciidoc-lint` from `asciidoc-linter`

* **setup.py**
  - Add `pyyaml` to the list of dependencies
  - Change console script entry point to `asciidoc-linter` from `asciidoc-lint`
* Change ENTRYPOINT from "asciidoc-lint" to "asciidoc-linter"
Copy link
Contributor

@ascheman ascheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to add https://peps.python.org/pep-0518/ (or PEP in general) to the AI to make it follow recommended Python practices.


# Install the project dependencies
RUN pip install --no-cache-dir -e .
RUN pip install pyyaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime dependencies should be part of pyproject.toml to satisfy arbitrary installations (not only Docker), cf. #15


[source,bash]
----
docker build -t asciidoc-linter .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a Docker compose.yml file which creates a tag for the new image so that it can easily be used by other projects as well.

@@ -13,6 +13,7 @@
"pytest-metadata",
"black",
"flake8",
"pyyaml",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a pyproject.toml and a setup.py which overlap?

@ascheman ascheman closed this Mar 4, 2025
@ascheman ascheman deleted the rdmueller/add-github-action-docker-image branch March 4, 2025 07:46
@ascheman ascheman restored the rdmueller/add-github-action-docker-image branch March 4, 2025 07:54
@ascheman
Copy link
Contributor

ascheman commented Mar 4, 2025

Accidentally removed branch ...

@ascheman ascheman reopened this Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants