Skip to content

Commit 5c694e9

Browse files
committed
feat: init repo
1 parent 8548dfe commit 5c694e9

21 files changed

+424
-2
lines changed

.dockerignore

Whitespace-only changes.

.env.example

Whitespace-only changes.

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
2+
3+
## Global owners
4+
* @jd-apprentice

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Description
2+
3+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
# How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
# Checklist:
24+
25+
- [ ] Do the application run in docker?
26+
- [ ] My code follows the style guidelines of this project
27+
- [ ] I have performed a self-review of my code
28+
- [ ] I have made corresponding changes to the documentation
29+

.github/workflows/release.yaml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Docker Publish
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ "develop" ]
7+
paths:
8+
- 'src/**'
9+
- 'infra/docker/**'
10+
- 'infra/kubernetes/**'
11+
- 'infra/terraform/**'
12+
- '.github/workflows/release.yml'
13+
- 'tests/**'
14+
push:
15+
branches: [ "develop", "master" ]
16+
paths:
17+
- 'src/**'
18+
19+
env:
20+
BRANCH_NAME: ${{ github.ref_name }}
21+
APP_NAME: app_name
22+
APP_VERSION: latest
23+
APP_DEV_VERSION: unstable
24+
25+
jobs:
26+
27+
test:
28+
name: test
29+
runs-on: ubuntu-latest
30+
steps:
31+
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: 1.23.2
39+
40+
- name: Test
41+
run: go test -v ./tests
42+
43+
## Enable to deploy in develop branch
44+
# develop:
45+
# runs-on: ubuntu-latest
46+
# needs: test
47+
# if: ${{ github.ref_name != 'master' }}
48+
# steps:
49+
# - name: Checkout
50+
# uses: actions/checkout@v4
51+
52+
# - name: Login to Docker Hub
53+
# uses: docker/login-action@v2
54+
# with:
55+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
56+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
57+
58+
# - name: Set up Docker Buildx
59+
# uses: docker/setup-buildx-action@v3
60+
61+
# - name: Build and push - AMD64 - UNSTABLE
62+
# uses: docker/build-push-action@v6
63+
# with:
64+
# context: .
65+
# file: infra/docker/Dockerfile
66+
# push: true
67+
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}:X64_${{ env.APP_DEV_VERSION }}
68+
# platforms: linux/amd64
69+
70+
# - name: Build and push - ARM64 - UNSTABLE
71+
# uses: docker/build-push-action@v4
72+
# with:
73+
# context: .
74+
# file: infra/docker/ARM64.Dockerfile
75+
# push: true
76+
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}:ARM64_${{ env.APP_DEV_VERSION }}
77+
# platforms: linux/arm64
78+
79+
## Enable to deploy in master branch
80+
# production:
81+
# runs-on: ubuntu-latest
82+
# needs: test
83+
# if: ${{ github.ref_name == 'master' && github.event_name != 'pull_request' }}
84+
# steps:
85+
# - name: Checkout
86+
# uses: actions/checkout@v4
87+
88+
# - name: Login to Docker Hub
89+
# uses: docker/login-action@v2
90+
# with:
91+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
92+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
93+
94+
# - name: Set up Docker Buildx
95+
# uses: docker/setup-buildx-action@v3
96+
97+
# - name: Build and push - AMD64 - PROD
98+
# uses: docker/build-push-action@v6
99+
# with:
100+
# context: .
101+
# file: infra/docker/Dockerfile
102+
# push: true
103+
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}:X64_${{ env.APP_VERSION }}
104+
# platforms: linux/amd64
105+
106+
# - name: Build and push - ARM64 - PROD
107+
# uses: docker/build-push-action@v4
108+
# with:
109+
# context: .
110+
# file: infra/docker/ARM64.Dockerfile
111+
# push: true
112+
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.APP_NAME }}:ARM64_${{ env.APP_VERSION }}
113+
# platforms: linux/arm64

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ go.work.sum
2323

2424
# env file
2525
.env
26+
27+
# Binary
28+
bin/

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
repos:
2+
- repo: https://github.com/dnephin/pre-commit-golang
3+
language: golang
4+
rev: v0.5.0
5+
hooks:
6+
- id: go-fmt
7+
- id: go-imports ## go install golang.org/x/tools/cmd/goimports@latest
8+
- id: no-go-testing
9+
- id: golangci-lint ## yay -S golangci-lint
10+
- id: go-unit-tests

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.0.1] 13-02-2025
11+
12+
### Added
13+
14+
- Initial release

CONTRIBUTE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 🤝 Contribute
2+
3+
- Fork the project
4+
- Create a new branch with your changes: `git checkout -b feature/my-feature`
5+
- For a fix or suggestion, create a new branch with your changes: `git checkout -b fix/my-fix`
6+
- Save your changes and create a commit message telling you what you did: `git commit -m "feature: My new feature"`
7+
- Submit your changes: `git push origin feature/my-feature`
8+
- Open a pull request with your branch
9+
- After the merge of your pull request is done, you can delete your branch
10+
- If you have any questions, please contact me at [email](mailto:contacto@jonathan.com.ar)

Makefile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
all: lint test imports build start
2+
3+
start:
4+
./bin/AppName
5+
6+
dev: path
7+
gowatch
8+
9+
fmt:
10+
@if [ -n "$$(go fmt ./src)" ]; then \
11+
echo "Code is not properly formatted"; \
12+
exit 1; \
13+
fi
14+
15+
pre-commit:
16+
pre-commit run --all
17+
18+
imports: path
19+
goimports -w ./src
20+
21+
lint: path
22+
golangci-lint run
23+
24+
lint-fix: path
25+
golangci-lint run --fix
26+
27+
clear:
28+
rm -rf ./bin
29+
30+
## https://github.com/golang-standards/project-layout/issues/113#issuecomment-1336514449
31+
build: clear fmt
32+
GOARCH=amd64 go build -o ./bin/AppName ./src/main.go
33+
34+
build-arm: clear fmt
35+
GOARCH=arm64 go build -o ./bin/AppName ./src/main.go
36+
37+
test:
38+
go test -v ./tests
39+
40+
path:
41+
export PATH=$$PATH:$$HOME/go/bin
42+
43+
### Kubernetes && Docker
44+
45+
## https://www.digitalocean.com/community/tutorials/how-to-use-minikube-for-local-kubernetes-development-and-testing
46+
k8s-up:
47+
minikube start
48+
49+
k8s-down:
50+
minikube stop
51+
52+
k8s-apply:
53+
kubectl apply -f ./infra/kubernetes
54+
55+
pods:
56+
kubectl get pods -A
57+
58+
compose-up:
59+
docker compose -f ./infra/docker/docker-compose.yml up -d --build
60+
61+
compose-down:
62+
docker compose -f ./infra/docker/docker-compose.yml down

0 commit comments

Comments
 (0)