Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base implementation of the structure of Eiffel-Goer. #1

Merged
merged 9 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.env
bin
!bin/README.md
data/
vendor/
.vscode/
pkg/**/**/test
cmd/**/**/test
internal/**/**/test
testdata/
test/testdata/
test/mock_*
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export RELEASE_VERSION ?= $(shell git describe --always)
export DOCKER_REGISTRY ?= registry.nordix.org/eiffel
export DEPLOY ?= goer

all: test build start
gen:
go generate ./...
build: gen
go get github.com/ahmetb/[email protected]
govvv build -o bin/goer ./cmd/goer
clean:
rm ./bin/* || true
docker-compose --project-directory . -f deploy/$(DEPLOY)/docker-compose.yml rm || true
docker volume rm goer-volume || true
test: gen
go test -cover -timeout 30s -race $(shell go list ./... | grep -v test)
t-persson marked this conversation as resolved.
Show resolved Hide resolved

# Start a development docker with a database that restarts on file changes.
start:
docker-compose --project-directory . -f deploy/$(DEPLOY)/docker-compose.yml up
stop:
docker-compose --project-directory . -f deploy/$(DEPLOY)/docker-compose.yml down

# Build a docker using the production Dockerfile
docker:
docker build -t $(DOCKER_REGISTRY)/$(DEPLOY):$(RELEASE_VERSION) -f ./deploy/$(DEPLOY)/Dockerfile .
push:
docker push $(DOCKER_REGISTRY)/$(DEPLOY):$(RELEASE_VERSION)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Eiffel Goer implements the event repository API and is intended as an open sourc

### Docker

docker run -e CONNECTION_STRING=yourdb -e DATABASE_NAME=dbname -e API_PORT=8080 registry.nordix.org/eiffel/goer
docker run -e CONNECTION_STRING=yourdb -e API_PORT=8080 registry.nordix.org/eiffel/goer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the makefile we always push to a tag that matches git describe. Will we ever have a latest tag that would be matched by this command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave it as is for now, but I see three scenarios that we could follow here:

  1. Always push latest when we push a new tag.
  2. Add an export VERSION=git describe command in the README.
  3. Always update the README when doing new version tags.

The third option feels best, but I will forget to do it on releases :)


### Running a development server locally for testing. Will restart on code changes.

Expand Down
Loading