From f522f0737d549d92bfcc35a07ccca2b3320b637e Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Wed, 10 Apr 2019 18:17:24 +0200 Subject: [PATCH 1/3] scaffold project setup and http server --- .circleci/config.yml | 22 ++++++++++++++++++++++ .editorconfig | 15 +++++++++++++++ Makefile | 4 ++++ README.md | 14 +++++++++++++- docker-compose.yml | 11 +++++++++++ 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml create mode 100644 .editorconfig create mode 100644 Makefile create mode 100644 docker-compose.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..25b9f42 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,22 @@ +version: 2 +jobs: + build: + docker: + - image: circleci/golang:1.12 + + working_directory: ~/offen + + steps: + - checkout + - restore_cache: + key: v1-dependencies-{{ checksum "server/go.mod" }} + - run: + name: Download modules + command: go mod download + - save_cache: + paths: + - /go/pkg/mod + key: v1-dependencies-{{ checksum "server/go.mod" }} + - run: + name: Run tests + command: make test diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..5461e42 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab + +[{*.js,*.yml,Gopkg.toml}] +indent_style = space +indent_size = 2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dc643f5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +test: test-server + +test-server: + @cd server; go test ./... diff --git a/README.md b/README.md index 3194de1..1e495bc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ # offen -The offen analytics software +> The offen analytics software + +This repository contains all source code needed to build and run __offen__, both on the server as well as on the client. + +--- + +Development of __offen__ has just started, so instructions are rare and things will stay highly volatile for quite some while. + +Guidelines for running and developing the Software will be added when it makes sense to do so. Feel free to open an issue if you have a question. + +### License + +MIT © [Frederik Ring](https://www.frederikring.com), [Hendrik Niefeld](http://niefeld.com/) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..04c45f3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +server: + image: golang:1.12 + working_dir: /server + volumes: + - ./server:/server + - $GOPATH/pkg/mod:/go/pkg/mod + environment: + - GOPATH=/go + ports: + - 8080:8080 + command: go run cmd/server/main.go From e29344a64c05f5550e44b332556afb87982d1a98 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Thu, 11 Apr 2019 15:48:36 +0200 Subject: [PATCH 2/3] ensure basic test coverage --- .circleci/config.yml | 20 +++++++++++++------- Makefile | 4 ---- 2 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 Makefile diff --git a/.circleci/config.yml b/.circleci/config.yml index 25b9f42..6f38a5d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,22 +1,28 @@ version: 2 + jobs: - build: + server: docker: - image: circleci/golang:1.12 - - working_directory: ~/offen - + working_directory: ~/offen/server steps: - - checkout + - checkout: + path: ~/offen - restore_cache: - key: v1-dependencies-{{ checksum "server/go.mod" }} + key: v1-dependencies-{{ checksum "go.mod" }} - run: name: Download modules command: go mod download - save_cache: paths: - /go/pkg/mod - key: v1-dependencies-{{ checksum "server/go.mod" }} + key: v1-dependencies-{{ checksum "go.mod" }} - run: name: Run tests command: make test + +workflows: + version: 2 + build_and_test: + jobs: + - server diff --git a/Makefile b/Makefile deleted file mode 100644 index dc643f5..0000000 --- a/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: test-server - -test-server: - @cd server; go test ./... From 63df99ff0bb4f4ce1471dc699f0891baff477e60 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Thu, 11 Apr 2019 20:19:57 +0200 Subject: [PATCH 3/3] implement in memory database --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6f38a5d..8edaa05 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,14 +9,14 @@ jobs: - checkout: path: ~/offen - restore_cache: - key: v1-dependencies-{{ checksum "go.mod" }} + key: offen-server-{{ checksum "go.mod" }} - run: name: Download modules command: go mod download - save_cache: paths: - /go/pkg/mod - key: v1-dependencies-{{ checksum "go.mod" }} + key: offen-server-{{ checksum "go.mod" }} - run: name: Run tests command: make test