Skip to content

Commit

Permalink
Merge branch 'master' into GH-6
Browse files Browse the repository at this point in the history
  • Loading branch information
gagafonov committed Apr 4, 2024
2 parents feb3d88 + 314491c commit 4dfa4ba
Show file tree
Hide file tree
Showing 531 changed files with 313 additions and 227,495 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
!dist/
.idea
vendor/
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG GO_VERSION=1.18
ARG ALPINE_VERSION=3.17

FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION}
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=1000

# Setup user
RUN adduser $USERNAME -s /bin/sh -D -u $USER_UID $USER_GID && \
mkdir -p /etc/sudoers.d && \
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME

# Install packages and Go language server
RUN apk add -q --update --progress --no-cache git sudo openssh-client build-base curl vim
RUN go clean -modcache

USER $USERNAME
ENV LANG=en_US.UTF-8

ENV GOPATH=/go
ENV GO111MODULE=on

RUN go install -v github.com/go-delve/delve/cmd/dlv@latest
RUN go install -v golang.org/x/tools/gopls@latest

ENV CONFIG="/home/vscode/workspaces/shaker/dev/config.yml"
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "OTT Shaker",
"dockerComposeFile": "docker-compose.yml",
"initializeCommand": "ls",
"service": "shaker",
"workspaceFolder": "/home/vscode/workspaces/${localWorkspaceFolderBasename}",

"customizations": {
"vscode": {
"extensions": [
"golang.go",
"mhutchie.git-graph",
"GitHub.copilot",
"ZainChen.json",
"esbenp.prettier-vscode"
],
"settings": {
"go.useLanguageServer": true,
"go.gopath": "/go",
"go.goroot": "/usr/local/go"
}
}
},

"postCreateCommand": "go mod tidy"
}
26 changes: 26 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.3'

volumes:
redis-data:

services:
shaker:
build:
context: .
dockerfile: Dockerfile

# env_file:
# - .env

command: sleep infinity

volumes:
- ..:/home/vscode/workspaces/shaker

db:
image: redis:latest
restart: unless-stopped
volumes:
- redis-data:/var/lib/postgresql/data
# env_file:
# - .env
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Go

on:
push:
tags:
- '*'

jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
GO111MODULE: on

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: 1.18

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Build
run: go build

- name: Prepare files for release
run: |
touch shaker_${{github.ref_name}}_linux-amd64.tar.gz
mkdir shaker_${{github.ref_name}}_linux-amd64
mv shaker shaker_${{github.ref_name}}_linux-amd64/
tar -czf shaker_${{github.ref_name}}_linux-amd64.tar.gz --exclude='./.*' --exclude=shaker_${{github.ref_name}}_linux-amd64.tar.gz shaker_${{github.ref_name}}_linux-amd64
- uses: ncipollo/release-action@v1.13.0
with:
name: Shaker_release_${{github.ref_name}}
artifacts: "shaker_${{github.ref_name}}_linux-amd64.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
!dist/
.idea
vendor/
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// 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": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"dlvFlags": ["--check-go-version=false"],
}
]
}
2 changes: 1 addition & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ users:

# Build

go build -mod vendor
go build

# For run

Expand Down
Empty file modified dev/config.yml
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion dev/http/test.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"uri": "api/myMethod4",
"user": "user1",
"method": "post",
"body": {}
"body": {},
"contentType": "application/json",
"userAgent": "test-user"
}
]
}
Empty file removed dev/redis/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions dev/redis/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"redis": "pubsub",
"jobs": [
{
"name": "Redis PubSub Pinger",
"method": "publish",
"channel": "slack is false",
"message": "{\"name\": \"PING\"}",
"cron": "* * * * *"
}
]
}
33 changes: 20 additions & 13 deletions go.mod
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
module shaker

go 1.18

require (
github.com/bamzi/jobrunner v0.0.0-20161019143021-273175f8b6eb
github.com/bamzi/jobrunner v1.0.0
github.com/bsm/redis-lock v8.0.0+incompatible
github.com/fsnotify/fsnotify v1.4.7
github.com/go-redis/redis v6.14.2+incompatible
github.com/gorilla/websocket v1.4.0 // indirect
github.com/lusis/go-slackbot v0.0.0-20180109053408-401027ccfef5 // indirect
github.com/lusis/slack-test v0.0.0-20180109053238-3c758769bfa6 // indirect
github.com/nlopes/slack v0.4.1-0.20181123205743-38ac5e8c495b
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/onsi/gomega v1.4.3 // indirect
github.com/pkg/errors v0.8.0 // indirect
github.com/sirupsen/logrus v1.2.0
gopkg.in/robfig/cron.v2 v2.0.0-20150107220207-be2e0b0deed5 // indirect
gopkg.in/yaml.v2 v2.2.1
github.com/fsnotify/fsnotify v1.6.0
github.com/go-redis/redis v6.15.9+incompatible
github.com/nlopes/slack v0.6.0
github.com/sirupsen/logrus v1.9.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/gorilla/websocket v1.2.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.24.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/robfig/cron/v3 v3.0.0 // indirect
github.com/stretchr/testify v1.8.1 // indirect
golang.org/x/sys v0.2.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
)
Loading

0 comments on commit 4dfa4ba

Please sign in to comment.