Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zthomas committed Nov 7, 2019
1 parent 3adee73 commit 9c40d2f
Show file tree
Hide file tree
Showing 5 changed files with 247 additions and 45 deletions.
19 changes: 9 additions & 10 deletions Makefile
Expand Up @@ -36,29 +36,28 @@ check:
fmt:
go fmt ./...

run:
go run main.go

build:
CGO_ENABLED=0 packr2 build -o commit0
packr2 clean

build-example: build clean-example
mkdir -p example
cd example && ../commit0 create "hello-world"
cd example/hello-world && ../../commit0 generate -l go

build-docker-local:
docker build . -t commit0:v0

build-example-docker: clean-example
mkdir -p example
docker run -v "$(shell pwd)/example:/project" --user $(shell id -u):$(shell id -g) commit0:v0 create "hello-world"
docker run -v "$(shell pwd)/example/hello-world:/project" --user $(shell id -u):$(shell id -g) commit0:v0 generate -l go

build-docker-local:
docker build . -t commit0:v0

clean-example:
rm -rf example

# builds
build:
CGO_ENABLED=0 packr2 build -o commit0
packr2 clean

# Installs the CLI int your GOPATH
install-go:
CGO_ENABLED=0 packr2 build -o ${GOPATH}/bin/commit0
packr2 clean
85 changes: 58 additions & 27 deletions README.md
Expand Up @@ -2,9 +2,43 @@

[![Build Status](https://travis-ci.org/commitdev/commit0.svg)](https://travis-ci.org/commitdev/commit0)

Status: currently poc
Status: Proof of Concept

Commit0 intends to be a multi-language service generator. The intention is to create a modular monolith, which is easy to seperate at a later stage when the boundries are completely understood.
Commit0 is an open source Push-To-Deploy tool designed to provide an amazing deployment process for developers while not compromising on dev ops best practices. Instead of using a Platform as a Service that simplifies your development but locks you in, we recreate the entire seamless workflow using open source technolgies and generate the infrastructure code for you while providing you with a simple interface.

With Commit0:
- You get the same simple Push-To-Deploy workflow that you are accustomed to with premium PaaS offerings
- Based on your configurations we'll generate all the infrastructure code that is needed to deploy and scale your application (Kubenetes manifests, Terraform, CI/CI configs etc.) and deploy to your own cloud provider.
- There's no vendor lock-in. It's all done with open source tools and generated code
- You don't need to know any dev ops to use Commit0 but if you are a dev ops engineer you can rest assured that you have a solid starting point and you can customize it as your project grows.
- We also include a set of commonly used open source microservices for tasks like authentication, user management, image resizing etc. so you can start developing the core application right away.

## Installation

As there alot of dependencies it will be easier to use this tool within the provided image, clone the repo and then run `make build-docker-local`.
The best way then to use this is to add an alias, then you can use the CLI as if it was installed as usual on your machine:
`alias commit0='docker run -v "$(pwd):/project" commit0:v0'`

## Usage

1) To create a project run `commit0 create [PROJECT_NAME]`
2) A folder will be created and within that update the `commit0.yml` and then run `commit0 generate -l=[LANGUAGE OF CHOICE] eg. go`
3) You will see that there is now an idl folder created.
4) Within the idl folder modify the the protobuf services generated with your desired methods
5) Go up to the parent directory and re run `commit0 generate -l=[LANGUAGE OF CHOICE]`
6) You will now see a `server` folder navigate to your service folder within that directory and implement the methods generated for it
7) Once you have tested your implementation and are happy with it return to the idl repo push that directory up to git
8) Return to the parent directory and check the depency file, for go it will be the go.mod file remove the lines that point it to your local directory, this will now point it to the version on git that was pushed up previously
10) Test and push up your implementation!
9) When you feel the need to add more services add them to the commit0 config and re-run `commit0 generate` and repeat steps 4 - 7.


## What does it generate?

The generation will create project folder, within this there will be your implementation and an IDL folder

* A parent directory that implements a skeleton and sets up your service implementation of the generated artifacts
* A child directory for the IDL's, this folder will also contain generated artifacts from the IDL under 'gen'

Based on specified config it will generate:
* Proto files [Done]
Expand All @@ -18,33 +52,35 @@ Based on specified config it will generate:

It will also live with your project, when you add a new service to the config it will generate everything needed for that new service.

## What does it generate?

The generation will create project folder, within this there will be your implementation and an IDL folder
## Development
We are looking for contributors!

* A parent directory that implements a skeleton and sets up your service implementation of the generated artifacts
* A child directory for the IDL's, this folder will also contain generated artifacts from the IDL under 'gen'
Building from the source
```
make build-deps
make deps-go
```
this will create a commit0 executable in your working direcory. To install install it into your go path use:
```
make install-go
```

## The development cycle
### Architecture
The project is built with GoLang and requires Docker
- /cmd - the CLI command entry points
- /internal/generate
- /internal/config
- /internal/templator - the templating service

1) To create a project run `commit0 create [PROJECT_NAME]`
2) A folder will be created and within that update the `commit0.yml` and then run `commit0 generate -l=[LANGUAGE OF CHOICE] eg. go`
3) You will see that there is now an idl folder created.
4) Within the idl folder modify the the protobuf services generated with your desired methods
5) Go up to the parent directory and re run `commit0 generate -l=[LANGUAGE OF CHOICE]`
6) You will now see a `server` folder navigate to your service folder within that directory and implement the methods generated for it
7) Once you have tested your implementation and are happy with it return to the idl repo push that directory up to git
8) Return to the parent directory and check the depency file, for go it will be the go.mod file remove the lines that point it to your local directory, this will now point it to the version on git that was pushed up previously
10) Test and push up your implementation!
9) When you feel the need to add more services add them to the commit0 config and re-run `commit0 generate` and repeat steps 4 - 7.
### Building locally

## Usage & installation
As the templates are embeded into the binary you will need to ensure packr2 is installed.

You can run `make deps-go` to install this.

As there alot of dependencies it will be easier to use this tool within the provided image, clone the repo and then run `make build-docker-local`.
The best way then to use this is to add an alias, then you can use the CLI as if it was installed as usual on your machine:
`alias commit0='docker run -v "$(pwd):/project" commit0:v0'`

## Dependencies
### Dependencies

In order to use this you need ensure you have these installed.
* protoc
Expand All @@ -53,9 +89,4 @@ In order to use this you need ensure you have these installed.
* protoc-gen-gateway [Http]
* protoc-gen-swagger [Swagger]

## Building locally

As the templates are embeded into the binary you will need to ensure packr2 is installed.

You can run `make deps-go` to install this.

3 changes: 0 additions & 3 deletions example/hello-world/commit0.yml
Expand Up @@ -4,8 +4,6 @@ description:
git-repo: github.com/yourrepo
docker-repo:
maintainers:
# - name: bob
# email: bob@test.com

network:
grpc:
Expand All @@ -18,5 +16,4 @@ network:
enabled: true
port: 8090


services:
31 changes: 26 additions & 5 deletions go.mod
Expand Up @@ -3,27 +3,48 @@ module github.com/commitdev/commit0
go 1.12

require (
cloud.google.com/go v0.47.0 // indirect
cloud.google.com/go/bigquery v1.2.0 // indirect
cloud.google.com/go/storage v1.1.2 // indirect
github.com/antihax/optional v1.0.0 // indirect
github.com/creack/pty v1.1.9 // indirect
github.com/gobuffalo/logger v1.0.1 // indirect
github.com/gobuffalo/packr/v2 v2.5.2
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/google/go-cmp v0.3.1 // indirect
github.com/google/pprof v0.0.0-20191105001904-73b556cfc1cf // indirect
github.com/grpc-ecosystem/grpc-gateway v1.12.0 // indirect
github.com/hashicorp/golang-lru v0.5.3 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/k0kubun/pp v3.0.1+incompatible
github.com/kr/pty v1.1.8 // indirect
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/prometheus/client_golang v1.1.0 // indirect
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
github.com/rogpeppe/fastuuid v1.2.0 // indirect
github.com/rogpeppe/go-internal v1.5.0 // indirect
github.com/russross/blackfriday v2.0.0+incompatible // indirect
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
go.opencensus.io v0.22.1 // indirect
golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf // indirect
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 // indirect
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect
golang.org/x/mobile v0.0.0-20191031020345-0945064e013a // indirect
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect
google.golang.org/grpc v1.24.0 // indirect
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.0.0-20191104232314-dc038396d1f0 // indirect
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 // indirect
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.4
gopkg.in/yaml.v2 v2.2.5
)

0 comments on commit 9c40d2f

Please sign in to comment.