Skip to content

Commit

Permalink
feat: initial repository commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Nov 9, 2022
0 parents commit ec683c0
Show file tree
Hide file tree
Showing 28 changed files with 894 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml,yaml}]
indent_size = 2

[*.yaml.j2]
indent_size = 2
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
include: "scope"
prefix: "github-actions"
labels:
- "deps"
open-pull-requests-limit: 10
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---

name: CI

on: # yamllint disable-line rule:truthy
push:
branches:
- 'master'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
release:
types:
- 'created'
schedule:
# Every Tuesday at 03:10
- cron: '10 3 * * 2'

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rabbitmq_version: ['alpine', 'management-alpine']
steps:
- uses: e1himself/goss-installation-action@v1.0.4

- name: Checkout
uses: actions/checkout@v3.1.0

- name: Set Environment Variables
env:
IMAGE_NAMESPACE: wayofdev/rabbitmq
TEMPLATE: ${{ matrix.rabbitmq_version }}
run: |
export RELEASE_VERSION=${GITHUB_REF#refs/*/}
echo "IMAGE_NAMESPACE=${IMAGE_NAMESPACE}" >> $GITHUB_ENV
echo "TEMPLATE=${TEMPLATE}" >> $GITHUB_ENV
echo "VERSION=${RELEASE_VERSION:1}" >> $GITHUB_ENV
- name: Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAMESPACE }}
tags: |
type=raw,event=branch,value=latest
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
flavor: |
latest=false
prefix=${{ matrix.rabbitmq_version }}-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

### For Cross Platform OSX builds uncomment these lines
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Build and Export to Docker
uses: docker/build-push-action@v3
with:
context: ./dist/${{ env.TEMPLATE }}
load: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}

- name: Test Docker Release Image
if: success() && startsWith(github.ref, 'refs/tags/')
run: |
IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-${{ env.VERSION }} make test
- name: Test Docker Master Image
if: success() && ! startsWith(github.ref, 'refs/tags/')
run: |
IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-latest make test
- name: Push Docker Image
uses: docker/build-push-action@v3
with:
context: ./dist/${{ env.TEMPLATE }}
### For Cross Platform OSX builds uncomment these lines
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}
cache-to: type=inline

...
39 changes: 39 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---

# https://github.com/google-github-actions/release-please-action#release-types-supported

on: # yamllint disable-line rule:truthy
push:
branches:
- master

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
release-type: node
package-name: docker-rabbitmq
default-branch: master
changelog-types: |
[
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
{ "type": "docs", "section": "Documentation", "hidden": false },
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
{ "type": "style", "section": "Styles", "hidden": true },
{ "type": "revert", "section": "Reverts", "hidden": true },
{ "type": "deps", "section": "Dependencies", "hidden": true },
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build System", "hidden": true },
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
]
...
27 changes: 27 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---

name: Differential ShellCheck

on: # yamllint disable-line rule:truthy
pull_request:

permissions:
contents: read

jobs:
shellcheck:
runs-on: ubuntu-latest

steps:
- name: Repository checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@latest
with:
severity: warning
token: ${{ secrets.GITHUB_TOKEN }}

...
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-encoding-pragma

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.37.0
hooks:
- id: commitizen
stages:
- commit-msg

...
61 changes: 61 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---

extends: "default"

ignore: |
.build/
vendor/
# Overwrite above default rules
rules:
braces:
# Defaults
# min-spaces-inside: 0
# max-spaces-inside: 0

# Keep 0 min-spaces to not error on empty {} collection definitions
min-spaces-inside: 0

# Allow one space inside braces to improve code readability
max-spaces-inside: 1

brackets:
# Defaults
# min-spaces-inside: 0
# max-spaces-inside: 0

# Keep 0 min-spaces to not error on empty [] collection definitions
min-spaces-inside: 0

# Allow one space inside braces to improve code readability
max-spaces-inside: 1

colons:
# Defaults
# min-spaces-before: 0
# max-spaces-after: 1

# Allow multiple spaces after a colon to allow indentation of YAML
# dictionary values
max-spaces-after: -1

commas:
# Defaults
# max-spaces-after: 1

# Allow multiple spaces after a comma to allow indentation of YAML
# dictionary values
max-spaces-after: -1

comments:
require-starting-space: true
min-spaces-from-content: 1

line-length:
max: 180
level: warning

yaml-files:
- "*.yaml"
- "*.yml"

...
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 @lotyp <lotyp7.woop@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit ec683c0

Please sign in to comment.