Skip to content

Commit

Permalink
Merge pull request #4 from zarbanio/fix-logger
Browse files Browse the repository at this point in the history
fix(logger): logger and actions
  • Loading branch information
amintalebi authored Oct 9, 2024
2 parents 0191884 + 4df18f6 commit 1088aa0
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 507 deletions.
86 changes: 45 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Market Maker Keeper - Build and Push
name: Market Maker Keeper - Build and Push

on:
push:
Expand All @@ -13,47 +13,51 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: registry.hamdocker.ir/bitex
username: ${{ secrets.HAMRAVESH_REGISTRY_USER }}
password: ${{ secrets.HAMRAVESH_REGISTRY_PASS }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
username: aminntalebi
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get the branch name
id: get-branch-name
run: |
if [[ $GITHUB_HEAD_REF ]]; then
BRANCH_NAME=${GITHUB_HEAD_REF}
else
BRANCH_NAME=${GITHUB_REF#refs/heads/}
fi
BRANCH_NAME=$(echo ${BRANCH_NAME} | sed 's/\//-/g' | cut -c 1-30)
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Login to Docker Registry - Hamdocker
uses: docker/login-action@v3
with:
registry: registry.hamdocker.ir/bitex
username: ${{ secrets.HAMRAVESH_REGISTRY_USER }}
password: ${{ secrets.HAMRAVESH_REGISTRY_PASS }}

- name: Get the branch name
id: get-branch-name
run: |
if [[ $GITHUB_HEAD_REF ]]; then
BRANCH_NAME=${GITHUB_HEAD_REF}
else
BRANCH_NAME=${GITHUB_REF#refs/heads/}
fi
BRANCH_NAME=$(echo ${BRANCH_NAME} | sed 's/\//-/g' | cut -c 1-30)
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Set Docker image tag
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
else
TAG=$(echo ${GITHUB_SHA::8})
fi
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Set Docker image tag
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
else
TAG=$(echo ${GITHUB_SHA::8})
fi
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Build and push market-make-keeper
uses: docker/build-push-action@v2
with:
file: Dockerfile
context: .
push: true
tags: registry.hamdocker.ir/bitex/market-maker-keeper:${{ env.TAG }}
- name: Build and push api to hamdocker
uses: docker/build-push-action@v4
with:
file: Dockerfile
context: .
push: true
tags: registry.hamdocker.ir/bitex/mmk:${{ env.TAG }}
build-args: |
GITHUB_TOKEN=${{ secrets.GH_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM golang:1.22.1 as builder
FROM golang:1.23.0 as builder
WORKDIR /build
COPY . .
RUN go env -w GO111MODULE=on && \
go env -w GOPROXY=https://goproxy.io,direct

RUN go mod download

RUN CGO_ENABLED=1 GOOS=linux go build -o main main.go
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags=-checklinkname=0 -o main main.go

FROM gcr.io/distroless/base-debian12

Expand Down
73 changes: 37 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
module github.com/zarbanio/market-maker-keeper

go 1.22
go 1.23.0

require (
github.com/cockroachdb/apd v1.1.0
github.com/ethereum/go-ethereum v1.12.0
github.com/google/uuid v1.3.0
github.com/jackc/pgx/v4 v4.18.1
github.com/ethereum/go-ethereum v1.12.2
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v4 v4.18.3
github.com/mitchellh/mapstructure v1.5.0
github.com/panjf2000/ants/v2 v2.7.5
github.com/rs/zerolog v1.15.0
github.com/shopspring/decimal v1.3.1
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.13.0
github.com/stretchr/testify v1.8.4
github.com/zarbanio/market-maker-keeper/x v0.0.0-00010101000000-000000000000
github.com/rs/zerolog v1.33.0
github.com/shopspring/decimal v1.4.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/zarbanio/market-maker-keeper/x v0.0.0-20241009202930-01918842d028
)

require (
Expand All @@ -24,8 +23,8 @@ require (
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.8.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
Expand All @@ -35,15 +34,15 @@ require (
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/fjl/memsize v0.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 // indirect
Expand All @@ -53,7 +52,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-bexpr v0.1.10 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
Expand All @@ -62,29 +61,28 @@ require (
github.com/huin/goupnp v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/pointerstructure v1.2.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
Expand All @@ -93,33 +91,36 @@ require (
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/crypto v0.17.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.15.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Expand Down
Loading

0 comments on commit 1088aa0

Please sign in to comment.