Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
yindia committed Oct 5, 2024
0 parents commit ddcf83a
Show file tree
Hide file tree
Showing 141 changed files with 42,132 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bin
deployment
localclients.json
.env
12 changes: 12 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SERVER_PORT=8080
WORKER_COUNT=500
SERVER_ENDPOINT="http://127.0.0.1:8080"
NEXT_PUBLIC_SERVER_ENDPOINT="http://127.0.0.1:8080"
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=tasks
DB_USERNAME=admin
DB_PASSWORD="admin"
DB_SSL_MODE=disable
DB_POOL_MAX_CONNS=50
TASK_TIME_OUT=3
11 changes: 11 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SERVER_PORT=8080
SERVER_ENDPOINT="http://task:8080"
NEXT_PUBLIC_SERVER_ENDPOINT="http://task:8080"
DB_HOST=db
DB_PORT=5432
DB_DATABASE=tasks
DB_USERNAME=admin
DB_PASSWORD="admin"
DB_SSL_MODE=disable
DB_POOL_MAX_CONNS=30
WORKER_COUNT=100
8 changes: 8 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SERVER_PORT=8086
DB_HOST=localhost
DB_PORT=8848
DB_DATABASE=tasks
DB_USERNAME=admin
DB_PASSWORD=admin
DB_SSL_MODE=disable
DB_POOL_MAX_CONNS=30
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

52 changes: 52 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go Checks

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"

- name: Setup
run: |
go mod tidy
go install github.com/vektra/mockery/[email protected]
- name: Build Server
run: go generate -v ./...

- name: Test
run: go test -v ./...

- name: Build Server
run: make build-server

- name: Build Server
run: make build-cli

container:
runs-on: ubuntu-latest

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

- name: Publish Image
run: |
make docker-build-server
make docker-build-cli
make docker-build-dashboard
67 changes: 67 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 🚀 Release

on:
push:
# run only against tags
tags:
- "*"

permissions:
actions: write
contents: read

jobs:
container:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Version from Tag
id: version
run: |
version=$(echo "${GITHUB_REF#refs/tags/}")
echo "Tagged version: $version"
echo "::set-output name=version::$version"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: yindia
password: ${{ secrets.GH_TOKEN }}
- name: Publish Image
run: |
VERSION="${{ steps.version.outputs.version }}" make push
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
with:
buf_user: yindia
buf_api_token: ${{ secrets.BUF_API_TOKEN }}
- uses: bufbuild/buf-push-action@v1
with:
input: idl
buf_token: ${{ secrets.BUF_API_TOKEN }}

goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
136 changes: 136 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Created by https://www.toptal.com/developers/gitignore/api/goland,go,macos
# Edit at https://www.toptal.com/developers/gitignore?templates=goland,go,macos

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

### Go Patch ###
/vendor/
/Godeps/

### Goland ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm, Rider and Goland
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Ignores the whole .idea folder and all .iml files
.idea/

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.toptal.com/developers/gitignore/api/goland,go,macos



bin
__pycache__/

.pixi/
.turbo/
clients/dashboard/.next/
clients/dashboard/node_modules/
clients/dashboard/pkg/
clients/dashboard/src/cloud/
dist/
node_modules/
test
charts/task/charts/
15 changes: 15 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
linters:
disable-all: true
enable:
- deadcode
- gas
- goimports
- gosimple
- ineffassign
- misspell
- nakedret
- structcheck
- typecheck
- unparam
- unused
- varcheck
Loading

0 comments on commit ddcf83a

Please sign in to comment.