From 7e2c78347d38800cf439d61de86fcef8bd06b70c Mon Sep 17 00:00:00 2001 From: lotyp Date: Thu, 12 Sep 2024 16:43:22 +0300 Subject: [PATCH] style: fix coding standards --- .github/CONTRIBUTING.md | 40 ++++++++++---------- README.md | 82 ++++++++++++++++++++++++++--------------- src/playbook.yml | 6 ++- src/roles/all/main.yml | 24 ++++++------ 4 files changed, 88 insertions(+), 64 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index dc287da..5c91abe 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Welcome to the docker-php-base project! +Welcome to the docker-nginx project! We appreciate your interest in contributing. This guide will help you get started, ensuring an effective collaboration. @@ -50,8 +50,8 @@ Optional tools: Clone the repository: ```bash -git clone git@github.com:wayofdev/docker-php-base.git && \ -cd docker-php-base +git clone git@github.com:wayofdev/docker-nginx.git && \ +cd docker-nginx ```
@@ -113,17 +113,17 @@ make test Our project employs [GitHub Actions](https://github.com/features/actions) for continuous integration, ensuring code quality and reliability. We encourage contributors to review our workflow configurations to understand the CI processes: -| Workflow | Description | -|--------------------------------------------------------------|---------------------------------------------------------------------| -| [`apply-labels.yml`](workflows/apply-labels.yml) | Auto labels PRs based on rules. | -| [`auto-merge-release.yml`](workflows/auto-merge-release.yml) | Automatically merges release PRs. | -| [`build.yml`](workflows/build.yml) | Builds Docker images. | -| [`coding-standards.yml`](workflows/coding-standards.yml) | Checks `yaml`, `md`, `composer`, `php` and commit coding standards. | -| [`create-release.yml`](workflows/create-release.yml) | Creates a release on GitHub. | -| [`merge.yml`](workflows/merge.yml) | Automatically merges PRs. | -| [`shellcheck.yml`](workflows/shellcheck.yml) | Checks shell scripts. | -| [`test.yml`](workflows/test.yml) | Runs tests on Docker images. | -| [`upload-assets.yml`](workflows/upload-assets.yml) | Uploads dist assets to GitHub releases. | +| Workflow | Description | +|--------------------------------------------------------------|--------------------------------------------------------------| +| [`apply-labels.yml`](workflows/apply-labels.yml) | Auto labels PRs based on rules. | +| [`auto-merge-release.yml`](workflows/auto-merge-release.yml) | Automatically merges release PRs. | +| [`build.yml`](workflows/build.yml) | Builds Docker images. | +| [`coding-standards.yml`](workflows/coding-standards.yml) | Checks `yaml`, `md`, `composer` and commit coding standards. | +| [`create-release.yml`](workflows/create-release.yml) | Creates a release on GitHub. | +| [`merge.yml`](workflows/merge.yml) | Automatically merges PRs. | +| [`shellcheck.yml`](workflows/shellcheck.yml) | Checks shell scripts. | +| [`test.yml`](workflows/test.yml) | Runs tests on Docker images. | +| [`upload-assets.yml`](workflows/upload-assets.yml) | Uploads dist assets to GitHub releases. |
@@ -314,12 +314,12 @@ Our pre-commit configuration includes several hooks: * **Action Validator**: Validates GitHub Actions workflow files. * **Ansible Lint**: Checks Ansible playbooks for practices and behavior that could potentially be improved. * **Ansible Role Checks**: Several hooks to find issues in Ansible roles: - * Find unused variables - * Find empty files - * Find empty directories - * Fix readability issues - * Find undefined handlers - * Find unquoted values + * Find unused variables + * Find empty files + * Find empty directories + * Fix readability issues + * Find undefined handlers + * Find unquoted values These hooks help maintain code quality, consistency, and prevent common issues before they are committed to the repository. diff --git a/README.md b/README.md index 5b7fbfa..ceb2be8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -
- -
-Logo -Logo -
- -
- -
+

+
+ + + + WayOfDev Logo + + +
+

Build Status @@ -40,7 +40,7 @@ For testing purposes we use **goss** and **dgoss**, follow installation instruct Generating distributable Dockerfiles from yaml source code: ```bash -$ make generate +make generate ```
@@ -48,22 +48,22 @@ $ make generate Building default image: ```bash -$ git clone git@github.com:wayofdev/docker-nginx.git -$ cd docker-nginx -$ make build +git clone git@github.com:wayofdev/docker-nginx.git +cd docker-nginx +make build ``` To **build** image, **test** it and then **clean** temporary files run: ```bash -$ make +make ``` Building all images: ```bash -$ make build IMAGE_TEMPLATE=dev-alpine -$ make build IMAGE_TEMPLATE=k8s-alpine +make build IMAGE_TEMPLATE=dev-alpine +make build IMAGE_TEMPLATE=k8s-alpine ```
@@ -73,14 +73,14 @@ $ make build IMAGE_TEMPLATE=k8s-alpine Testing default image: ```bash -$ make test +make test ``` To test all images: ```bash -$ make test IMAGE_TEMPLATE=dev-alpine -$ make test IMAGE_TEMPLATE=k8s-alpine +make test IMAGE_TEMPLATE=dev-alpine +make test IMAGE_TEMPLATE=k8s-alpine ```
@@ -90,41 +90,63 @@ $ make test IMAGE_TEMPLATE=k8s-alpine Run **yamllint** to validate all yaml files in project: ```bash -$ make lint-yaml +make lint-yaml ``` Run hadolint to validate created Dockerfiles: ```bash -$ make lint-docker +make lint-docker ``` Run ansible-lint to validate project files: ```bash -$ make lint-ansible +make lint-ansible ```
-## 🤝 License +## 🔒 Security Policy -[![Licence](https://img.shields.io/github/license/wayofdev/docker-nginx?style=for-the-badge&color=blue)](./LICENSE) +This project has a [security policy](.github/SECURITY.md).
-## 🙆🏼‍♂️ Author Information +## 🙌 Want to Contribute? + +Thank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to: + +- 🤔 [Suggest a feature](https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+enhancement&projects=&template=2-feature-request.yml&title=%5BFeature%5D%3A+) +- 🐛 [Report an issue](https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=1-bug-report.yml&title=%5BBug%5D%3A+) +- 📖 [Improve documentation](https://github.com/wayofdev/docker-nginx/issues/new?assignees=&labels=type%3A+documentation%2Ctype%3A+maintenance&projects=&template=4-docs-bug-report.yml&title=%5BDocs%5D%3A+) +- 👨‍💻 [Contribute to the code](./.github/CONTRIBUTING.md) -This repository was created in **2022** by [lotyp / wayofdev](https://github.com/wayofdev). +You are more than welcome. Before contributing, kindly check our [contribution guidelines](.github/CONTRIBUTING.md). + +[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)
## 🫡 Contributors - - +

- Supporters +Contributors Badge +
+
+

+ +## 🌐 Social Links + +- **Twitter:** Follow our organization [@wayofdev](https://twitter.com/intent/follow?screen_name=wayofdev) and the author [@wlotyp](https://twitter.com/intent/follow?screen_name=wlotyp). +- **Discord:** Join our community on [Discord](https://discord.gg/CE3TcCC5vr). + +
+ +## ⚖️ License + +[![Licence](https://img.shields.io/github/license/wayofdev/docker-nginx?style=for-the-badge&color=blue)](./LICENSE.md)
diff --git a/src/playbook.yml b/src/playbook.yml index a371037..8276099 100644 --- a/src/playbook.yml +++ b/src/playbook.yml @@ -1,10 +1,12 @@ --- -- hosts: all +- name: Generate nginx Dockerfiles + hosts: all gather_facts: false tags: - template tasks: - - import_tasks: roles/all/main.yml + - name: Create dist for all supported nginx versions + ansible.builtin.import_tasks: roles/all/main.yml ... diff --git a/src/roles/all/main.yml b/src/roles/all/main.yml index 3db34ef..b6000c1 100644 --- a/src/roles/all/main.yml +++ b/src/roles/all/main.yml @@ -1,59 +1,59 @@ --- - name: Load k8s variables - include_vars: + ansible.builtin.include_vars: file: group_vars/k8s.yml name: type when: level == "k8s" - name: Load dev variables - include_vars: + ansible.builtin.include_vars: file: group_vars/dev.yml name: type when: level == "dev" - name: Create dist directories - file: + ansible.builtin.file: path: "{{ item.path }}" state: directory - mode: 0775 + mode: "0775" recurse: true with_items: - "{{ tpl_directories }}" - name: Generate Dockerfiles - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: true - mode: 0644 + mode: "0644" with_items: - "{{ tpl_dockerfiles }}" - name: Generate nginx configuration files - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: true - mode: 0644 + mode: "0644" with_items: - "{{ tpl_configs }}" - name: Generate Dockerfile dgoss tests - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: true - mode: 0644 + mode: " 0644" with_items: - "{{ tpl_docker_tests }}" - name: Copy SSL certs - template: + ansible.builtin.template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: true - mode: 0644 + mode: "0644" with_items: - "{{ tpl_certs }}"