-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from aacebedo/aacebedo/project_revamp
Project revamp
- Loading branch information
Showing
40 changed files
with
951 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[tool.commitizen] | ||
name = "cz_conventional_commits" | ||
tag_format = "v$version" | ||
version_scheme = "semver" | ||
version = "1.16.4" | ||
update_changelog_on_bump = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM ubuntu:mantic | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends \ | ||
ca-certificates=20230311ubuntu1 \ | ||
apt-utils=2.7.3 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install --no-install-recommends \ | ||
git=1:2.40.1-1ubuntu1 \ | ||
golang=2:1.21~2 \ | ||
zsh=5.9-5ubuntu1 \ | ||
tree=2.1.1-1 \ | ||
neovim=0.7.2-7 \ | ||
wget=1.21.3-1ubuntu1 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN export GOBIN=/usr/local/bin \ | ||
&& go install github.com/golangci/golangci-lint/cmd/[email protected] \ | ||
&& go install golang.org/x/tools/[email protected] \ | ||
&& go install github.com/goreleaser/[email protected] \ | ||
&& go install github.com/go-delve/delve/cmd/[email protected] | ||
|
||
RUN wget -q -O /usr/local/bin/hadolint \ | ||
https://github.com/hadolint/hadolint/releases/download/v2.8.0/hadolint-Linux-x86_64 \ | ||
&& chmod +x /usr/local/bin/hadolint | ||
|
||
ENV DEBIAN_FRONTEND=dialog | ||
|
||
SHELL ["/bin/zsh", "-c"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "Dnsdock dev container", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/zsh", | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "zsh", | ||
"icon": "terminal-bash" | ||
} | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-azuretools.vscode-docker", | ||
"premparihar.gotestexplorer", | ||
"golang.go", | ||
"github.vscode-github-actions", | ||
"KnisterPeter.vscode-commitizen", | ||
"eamodio.gitlens", | ||
"mhutchie.git-graph", | ||
"yzhang.markdown-all-in-one", | ||
"esbenp.prettier-vscode" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
[*.go] | ||
insert_final_newline = ignore | ||
indent_style = tabs | ||
|
||
[*.json] | ||
insert_final_newline = ignore | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Commit Checks | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
base_sha: | ||
description: 'Base SHA to check from' | ||
required: true | ||
type: string | ||
head_sha: | ||
description: 'Head SHA to check until' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
commit_messages_checks: | ||
name: Commit messages checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
with: | ||
devbox-version: 0.8.5 | ||
enable-cache: 'true' | ||
|
||
- name: Check commit messages | ||
run: devbox run -- cz check --rev-range ${{ inputs.base_sha }}..${{ inputs.head_sha }} | ||
|
||
code_lint_checks: | ||
name: Code lint checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
with: | ||
devbox-version: 0.8.5 | ||
enable-cache: 'true' | ||
|
||
- name: Lint code | ||
run: devbox run lint | ||
|
||
test_checks: | ||
name: Test checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
with: | ||
devbox-version: 0.8.5 | ||
enable-cache: 'true' | ||
|
||
- name: Run tests | ||
run: devbox run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: main branch workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
commit_checks: | ||
name: Commit checks | ||
uses: ./.github/workflows/commit_checks.yml | ||
with: | ||
base_sha: ${{ github.event.before }} | ||
head_sha: ${{ github.event.after }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: PR workflow | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
commit_checks: | ||
name: Commit checks | ||
uses: ./.github/workflows/commit_checks.yml | ||
with: | ||
base_sha: ${{ github.event.pull_request.base.sha }} | ||
head_sha: ${{ github.event.pull_request.head.sha }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release workflow | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create_release: | ||
name: Create release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install devbox | ||
uses: jetpack-io/[email protected] | ||
with: | ||
devbox-version: 0.8.5 | ||
enable-cache: 'true' | ||
|
||
- name: Publish release | ||
run: devbox run release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Release workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Create bump and changelog | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
changelog_increment_filename: CHANGELOG.md | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: "CHANGELOG.md" | ||
tag_name: ${{ env.REVISION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
dnsdock | ||
dnsdock | ||
.go | ||
.devbox | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
|
||
# The lines below are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/need to use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj | ||
|
||
version: 1 | ||
|
||
before: | ||
hooks: | ||
- devbox run test | ||
- devbox run lint | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/dnsdock | ||
goarch: | ||
- amd64 | ||
- arm | ||
goos: | ||
- linux | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{ .Version }}_ | ||
{{ .Os }}_ | ||
{{ .Arch }}{{ if eq .Arch "arm" }}v{{ .Arm }}l{{ end }} | ||
release: | ||
prerelease: auto | ||
draft: true | ||
github: | ||
owner: aacebedo | ||
name: dnsdock | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
|
||
dockers: | ||
- id: amd64 image | ||
goos: linux | ||
|
||
goarch: amd64 | ||
|
||
image_templates: | ||
- aacebedo/dnsdock:latest | ||
- aacebedo/dnsdock:{{ .Tag }} | ||
|
||
# hooks: | ||
# pre: docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
# post: docker push aacebedo/dnsdock:latest && docker push aacebedo/dnsdock:{{ .Tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repos: | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.13.0 | ||
hooks: | ||
- id: commitizen |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Run dnsdock", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"program": "cmd/dnsdock/dnsdock.go" | ||
} | ||
] | ||
} |
Oops, something went wrong.