Skip to content

Commit 2411ea5

Browse files
committed
feat: initial repository commit
1 parent 9433f05 commit 2411ea5

32 files changed

+811
-1
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.{yml,yaml}]
12+
indent_size = 2
13+
14+
[*.yaml.j2]
15+
indent_size = 2

.github/dependabot.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
commit-message:
10+
include: "scope"
11+
prefix: "github-actions"
12+
labels:
13+
- "deps"
14+
open-pull-requests-limit: 10

.github/workflows/ci.yml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
3+
name: CI
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches:
8+
- 'master'
9+
tags:
10+
- 'v*.*.*'
11+
pull_request:
12+
branches:
13+
- 'master'
14+
release:
15+
types:
16+
- 'created'
17+
schedule:
18+
# Every sunday at 01:10
19+
- cron: '10 1 * * 0'
20+
21+
jobs:
22+
build:
23+
name: Build
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
postgres_version: ['14', '15']
29+
os_version: ['alpine']
30+
steps:
31+
- uses: e1himself/[email protected]
32+
33+
- name: Checkout
34+
uses: actions/[email protected]
35+
36+
- name: Set Environment Variables
37+
env:
38+
IMAGE_NAMESPACE: wayofdev/postgres
39+
TEMPLATE: ${{ matrix.postgres_version }}-${{ matrix.os_version }}
40+
run: |
41+
export RELEASE_VERSION=${GITHUB_REF#refs/*/}
42+
echo "IMAGE_NAMESPACE=${IMAGE_NAMESPACE}" >> $GITHUB_ENV
43+
echo "TEMPLATE=${TEMPLATE}" >> $GITHUB_ENV
44+
echo "VERSION=${RELEASE_VERSION:1}" >> $GITHUB_ENV
45+
46+
- name: Docker Meta
47+
id: meta
48+
uses: docker/metadata-action@v3
49+
with:
50+
images: ${{ env.IMAGE_NAMESPACE }}
51+
tags: |
52+
type=raw,event=branch,value=latest
53+
type=ref,event=pr
54+
type=semver,pattern={{version}}
55+
type=semver,pattern={{major}}.{{minor}}
56+
flavor: |
57+
latest=false
58+
prefix=${{ matrix.postgres_version }}-${{ matrix.os_version }}-
59+
60+
- name: Login to DockerHub
61+
if: github.event_name != 'pull_request'
62+
uses: docker/login-action@v2
63+
with:
64+
username: ${{ secrets.DOCKER_USERNAME }}
65+
password: ${{ secrets.DOCKER_TOKEN }}
66+
67+
### For Cross Platform OSX builds uncomment these lines
68+
- name: Set up QEMU
69+
uses: docker/setup-qemu-action@v2
70+
with:
71+
platforms: arm64
72+
73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v2
75+
with:
76+
install: true
77+
78+
- name: Build and Export to Docker
79+
uses: docker/build-push-action@v3
80+
with:
81+
context: ./dist/${{ env.TEMPLATE }}
82+
load: true
83+
tags: ${{ steps.meta.outputs.tags }}
84+
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}
85+
cache-to: type=inline
86+
labels: ${{ steps.meta.outputs.labels }}
87+
88+
- name: Test Docker Release Image
89+
if: success() && startsWith(github.ref, 'refs/tags/')
90+
run: |
91+
IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-${{ env.VERSION }} make test
92+
93+
- name: Test Docker Master Image
94+
if: success() && ! startsWith(github.ref, 'refs/tags/')
95+
run: |
96+
IMAGE_TAG=${{ env.IMAGE_NAMESPACE }}:${{ env.TEMPLATE }}-latest make test
97+
98+
- name: Push Docker Image
99+
uses: docker/build-push-action@v3
100+
with:
101+
context: ./dist/${{ env.TEMPLATE }}
102+
### For Cross Platform OSX builds uncomment these lines
103+
platforms: linux/amd64,linux/arm64
104+
push: ${{ github.event_name != 'pull_request' }}
105+
tags: ${{ steps.meta.outputs.tags }}
106+
cache-from: type=registry,ref=${{ env.IMAGE_TAG }}
107+
cache-to: type=inline
108+
109+
...

.github/workflows/release-please.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
3+
# https://github.com/google-github-actions/release-please-action#release-types-supported
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches:
8+
- master
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: google-github-actions/release-please-action@v3
17+
id: release
18+
with:
19+
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
20+
release-type: node
21+
package-name: docker-postgres
22+
default-branch: master
23+
changelog-types: |
24+
[
25+
{ "type": "feat", "section": "Features", "hidden": false },
26+
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
27+
{ "type": "perf", "section": "Performance Improvements", "hidden": false },
28+
{ "type": "docs", "section": "Documentation", "hidden": false },
29+
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
30+
{ "type": "style", "section": "Styles", "hidden": true },
31+
{ "type": "revert", "section": "Reverts", "hidden": true },
32+
{ "type": "deps", "section": "Dependencies", "hidden": true },
33+
{ "type": "refactor", "section": "Code Refactoring", "hidden": true },
34+
{ "type": "test", "section": "Tests", "hidden": true },
35+
{ "type": "build", "section": "Build System", "hidden": true },
36+
{ "type": "ci", "section": "Continuous Integration", "hidden": true }
37+
]
38+
39+
...

.github/workflows/shellcheck.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
name: Differential ShellCheck
4+
5+
on: # yamllint disable-line rule:truthy
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
shellcheck:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Repository checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Differential ShellCheck
22+
uses: redhat-plumbers-in-action/differential-shellcheck@latest
23+
with:
24+
severity: warning
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
...

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

.pre-commit-config.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: fix-encoding-pragma
10+
11+
- repo: https://github.com/commitizen-tools/commitizen
12+
rev: v2.29.5
13+
hooks:
14+
- id: commitizen
15+
stages:
16+
- commit-msg

.yamllint

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
3+
extends: "default"
4+
5+
ignore: |
6+
.build/
7+
vendor/
8+
# Overwrite above default rules
9+
rules:
10+
braces:
11+
# Defaults
12+
# min-spaces-inside: 0
13+
# max-spaces-inside: 0
14+
15+
# Keep 0 min-spaces to not error on empty {} collection definitions
16+
min-spaces-inside: 0
17+
18+
# Allow one space inside braces to improve code readability
19+
max-spaces-inside: 1
20+
21+
brackets:
22+
# Defaults
23+
# min-spaces-inside: 0
24+
# max-spaces-inside: 0
25+
26+
# Keep 0 min-spaces to not error on empty [] collection definitions
27+
min-spaces-inside: 0
28+
29+
# Allow one space inside braces to improve code readability
30+
max-spaces-inside: 1
31+
32+
colons:
33+
# Defaults
34+
# min-spaces-before: 0
35+
# max-spaces-after: 1
36+
37+
# Allow multiple spaces after a colon to allow indentation of YAML
38+
# dictionary values
39+
max-spaces-after: -1
40+
41+
commas:
42+
# Defaults
43+
# max-spaces-after: 1
44+
45+
# Allow multiple spaces after a comma to allow indentation of YAML
46+
# dictionary values
47+
max-spaces-after: -1
48+
49+
comments:
50+
require-starting-space: true
51+
min-spaces-from-content: 1
52+
53+
line-length:
54+
max: 180
55+
level: warning
56+
57+
yaml-files:
58+
- "*.yaml"
59+
- "*.yml"
60+
61+
...

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 @lotyp <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)