Skip to content

Commit

Permalink
Moved volumes folder to internal folder. Moved main.go file to the pr…
Browse files Browse the repository at this point in the history
…oject's root instead of the cmd directory.
  • Loading branch information
kelvinmwinuka committed Jul 4, 2024
1 parent eb94269 commit c6a85b6
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
.idea
.DS_Store
bin
volumes/nodes
internal/volumes/nodes
dist/
pkg/modules/*/aof
pkg/echovault/aof
dump.rdb
**/*/testdata
echovault/aof
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ COPY . ./
ENV CGO_ENABLED=1 CC=gcc GOOS=linux GOARCH=amd64

ENV DEST=volumes/modules
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_set/module_set.so ./volumes/modules/module_set/module_set.go
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_get/module_get.so ./volumes/modules/module_get/module_get.go
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -buildmode=plugin -o $DEST/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go

ENV DEST=bin/linux/x86_64
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server ./cmd/main.go
RUN CGO_ENABLED=$CGO_ENABLED CC=$CC GOOS=$GOOS GOARCH=$GOARCH go build -o $DEST/server .



Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ run:
docker-compose up --build

build-local:
CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go && \
CGO_ENABLED=1 go build -o ./bin ./cmd/...
CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build -buildmode=plugin -o ./bin/modules/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go && \
CGO_ENABLED=1 go build -o ./bin ./...


build-modules-test:
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_set/module_set.so ./internal/volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_get/module_get.so ./internal/volumes/modules/module_get/module_get.go

test:
env RACE=false OUT=internal/modules/admin/testdata make build-modules-test && \
Expand Down
24 changes: 12 additions & 12 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ services:
- "7480:7480"
- "7946:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/standalone_node:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/standalone_node:/var/lib/echovault
networks:
- testnet

Expand Down Expand Up @@ -89,8 +89,8 @@ services:
- "7481:7480"
- "7945:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/cluster_node_1:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/cluster_node_1:/var/lib/echovault
networks:
- testnet

Expand Down Expand Up @@ -133,8 +133,8 @@ services:
- "7482:7480"
- "7947:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/cluster_node_2:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/cluster_node_2:/var/lib/echovault
networks:
- testnet

Expand Down Expand Up @@ -177,8 +177,8 @@ services:
- "7483:7480"
- "7948:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/cluster_node_3:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/cluster_node_3:/var/lib/echovault
networks:
- testnet

Expand Down Expand Up @@ -221,8 +221,8 @@ services:
- "7484:7480"
- "7949:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/cluster_node_4:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/cluster_node_4:/var/lib/echovault
networks:
- testnet

Expand Down Expand Up @@ -265,7 +265,7 @@ services:
- "7485:7480"
- "7950:7946"
volumes:
- ./volumes/config:/etc/echovault/config
- ./volumes/nodes/cluster_node_5:/var/lib/echovault
- ./internal/volumes/config:/etc/echovault/config
- ./internal/volumes/nodes/cluster_node_5:/var/lib/echovault
networks:
- testnet
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c6a85b6

Please sign in to comment.