Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
chore: update go version
Browse files Browse the repository at this point in the history
  • Loading branch information
maxyzli committed Oct 10, 2023
1 parent 4301dc4 commit 32b1751
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 50 deletions.
32 changes: 21 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,45 @@
APP=mccs

GIT_TAG = $(shell if [ "`git describe --tags --abbrev=0 2>/dev/null`" != "" ];then git describe --tags --abbrev=0; else git log --pretty=format:'%h' -n 1; fi)
APP = mccs
# Get the latest Git tag, or if not available, get the latest commit hash.
GIT_TAG = $(shell if [ "`git describe --tags --abbrev=0 2>/dev/null`" != "" ]; then git describe --tags --abbrev=0; else git log --pretty=format:'%h' -n 1; fi)
# Get the current date and time in UTC in ISO 8601 format.
BUILD_DATE = $(shell TZ=UTC date +%FT%T%z)
# Get the hash of the latest commit.
GIT_COMMIT = $(shell git log --pretty=format:'%H' -n 1)
GIT_TREE_STATUS = $(shell if git status|grep -q 'clean';then echo clean; else echo dirty; fi)
# Check the status of the Git tree, determining whether it's clean or dirty.
GIT_TREE_STATUS = $(shell if git status | grep -q 'clean'; then echo clean; else echo dirty; fi)

# Production target for starting the production server.
production:
@echo "=============starting production server============="
@echo "============= Starting production server ============="
GIT_TAG=${GIT_TAG} BUILD_DATE=${BUILD_DATE} GIT_COMMIT=${GIT_COMMIT} GIT_TREE_STATUS=${GIT_TREE_STATUS} \
docker-compose -f docker-compose.production.yml up --build

# Clean target for removing the application.
clean:
@echo "=============removing app============="
@echo "============= Removing app ============="
rm -f ${APP}

# Run target for starting the server using the development Docker Compose configuration.
run:
@echo "=============starting server============="
@echo "============= Starting server ============="
docker-compose -f docker-compose.dev.yml up --build

# Test target for running unit tests on the application.
test:
@echo "=============running test============="
@echo "============= Running tests ============="
go test ./...

# Seed target for generating seed data.
seed:
@echo "=============generating seed data============="
@echo "============= Generating seed data ============="
go run cmd/seed/main.go -config="seed"

# es-restore target for restoring Elasticsearch data.
es-restore:
@echo "=============restoring es data============="
@echo "============= Restoring Elasticsearch data ============="
go run cmd/es-restore/main.go -config="seed"

# pg-setup target for setting up PostgreSQL accounts.
pg-setup:
@echo "=============setup pg accounts============="
@echo "============= Setting up PostgreSQL accounts ============="
go run cmd/pg-setup/main.go -config="seed"
13 changes: 8 additions & 5 deletions dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.13
# Base image from which we are building.
FROM golang:1.19.5-alpine

WORKDIR /usr/src/app

COPY go.mod .
COPY go.sum .
COPY go.mod go.sum ./

RUN go get -v -t -d ./...
# Download the dependencies listed in the go.mod file.
RUN go mod download

RUN go get github.com/cespare/reflex
# Install reflex, a tool for hot reloading of Go applications.
RUN go install github.com/cespare/reflex@latest

# The CMD instruction provides defaults for executing the container.
CMD ["reflex", "-c", "./reflex.dev.conf"]
8 changes: 4 additions & 4 deletions dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.13 as builder
FROM golang:1.19.5-alpine

WORKDIR /temp

COPY go.mod .
COPY go.sum .
COPY go.mod go.sum ./

RUN go get -v -t -d ./...
# Download the dependencies listed in the go.mod file.
RUN go mod download

COPY . .

Expand Down
55 changes: 44 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,33 +1,66 @@
module github.com/ic3network/mccs-alpha

go 1.13
go 1.19

require (
github.com/DataDog/zstd v1.4.4 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fsnotify/fsnotify v1.4.7
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gofrs/uuid v3.2.0+incompatible
github.com/gorilla/mux v1.7.3
github.com/jinzhu/gorm v1.9.12
github.com/jinzhu/now v1.1.1
github.com/oleiade/reflections v1.0.0 // indirect
github.com/olivere/elastic/v7 v7.0.10
github.com/pkg/errors v0.9.0
github.com/robfig/cron v1.2.0
github.com/segmentio/ksuid v1.0.2
github.com/sendgrid/rest v2.4.1+incompatible // indirect
github.com/sendgrid/sendgrid-go v3.5.0+incompatible
github.com/shirou/gopsutil v2.19.12+incompatible
github.com/spf13/viper v1.6.1
github.com/stretchr/testify v1.4.0
github.com/tidwall/pretty v1.0.0 // indirect
github.com/unrolled/render v1.0.1
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
github.com/xdg/stringprep v1.0.0 // indirect
go.mongodb.org/mongo-driver v1.2.1
go.mongodb.org/mongo-driver v1.12.1
go.uber.org/zap v1.13.0
golang.org/x/crypto v0.0.0-20200109152110-61a87790db17
golang.org/x/crypto v0.1.0
gopkg.in/oleiade/reflections.v1 v1.0.0
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/lib/pq v1.1.1 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/oleiade/reflections v1.0.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sendgrid/rest v2.4.1+incompatible // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
go.uber.org/atomic v1.5.0 // indirect
go.uber.org/multierr v1.3.0 // indirect
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect
golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.1.12 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
honnef.co/go/tools v0.0.1-2019.2.3 // indirect
)
Loading

0 comments on commit 32b1751

Please sign in to comment.