Skip to content

Commit

Permalink
style: fix coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Sep 12, 2024
1 parent b23fd25 commit 7e2c783
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 64 deletions.
40 changes: 20 additions & 20 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -50,8 +50,8 @@ Optional tools:
Clone the repository:

```bash
git clone [email protected]:wayofdev/docker-php-base.git && \
cd docker-php-base
git clone [email protected]:wayofdev/docker-nginx.git && \
cd docker-nginx
```

<br>
Expand Down Expand Up @@ -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. |

<br>

Expand Down Expand Up @@ -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.

Expand Down
82 changes: 52 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<br>

<div align="center">
<img alt="Logo" width="456" src="https://raw.githubusercontent.com/wayofdev/docker-nginx/master/assets/logo.gh-light-mode-only.png#gh-light-mode-only">
<img alt="Logo" width="456" src="https://raw.githubusercontent.com/wayofdev/docker-nginx/master/assets/logo.gh-dark-mode-only.png#gh-dark-mode-only">
</div>

<br>

<br>
<p align="center">
<br>
<a href="https://wayof.dev" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-dark-mode-only.png">
<img width="400" src="https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-light-mode-only.png" alt="WayOfDev Logo">
</picture>
</a>
<br>
</p>

<div align="center">
<a href="https://actions-badge.atrox.dev/wayofdev/docker-nginx/goto"><img alt="Build Status" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fdocker-nginx%2Fbadge&style=flat-square"/></a>
Expand Down Expand Up @@ -40,30 +40,30 @@ For testing purposes we use **goss** and **dgoss**, follow installation instruct
Generating distributable Dockerfiles from yaml source code:

```bash
$ make generate
make generate
```

<br>

Building default image:

```bash
$ git clone [email protected]:wayofdev/docker-nginx.git
$ cd docker-nginx
$ make build
git clone [email protected]: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
```

<br>
Expand All @@ -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
```

<br>
Expand All @@ -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
```

<br>

## 🤝 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).

<br>

## 🙆🏼‍♂️ 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)

<br>

## 🫡 Contributors

<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/docker-nginx?style=for-the-badge"/>

<p align="left">
<a href="https://github.com/wayofdev/docker-nginx/graphs/contributors">
<img src="https://opencollective.com/wod/contributors.svg?width=890&button=false" alt="Supporters">
<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/docker-nginx?style=for-the-badge" alt="Contributors Badge"/>
</a>
<br>
<br>
</p>

## 🌐 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).

<br>

## ⚖️ License

[![Licence](https://img.shields.io/github/license/wayofdev/docker-nginx?style=for-the-badge&color=blue)](./LICENSE.md)

<br>
6 changes: 4 additions & 2 deletions src/playbook.yml
Original file line number Diff line number Diff line change
@@ -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

...
24 changes: 12 additions & 12 deletions src/roles/all/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}"

Expand Down

0 comments on commit 7e2c783

Please sign in to comment.