Status: Proof of Concept
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.
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'
- To create a project run
commit0 create [PROJECT_NAME] - A folder will be created and within that update the
commit0.ymland then runcommit0 generate -c <commit0.yml> - You will see that there is now an idl folder created.
- Within the idl folder modify the the protobuf services generated with your desired methods
- Go up to the parent directory and re run
commit0 generate -c <commit0.yml> - You will now see a
serverfolder navigate to your service folder within that directory and implement the methods generated for it - Once you have tested your implementation and are happy with it return to the idl repo push that directory up to git
- 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
- Test and push up your implementation!
- When you feel the need to add more services add them to the commit0 config and re-run
commit0 generateand repeat steps 4 - 7.
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]
- Proto libraries [Done]
- GraphQL files [Later]
- GraphQL libraries [Later]
- grpc web [Partial - Libraries generates for typescript]
- grpc gateway [ Partial - generates swagger & grpc gateway libraries]
- Layout [Done for go]
- Kubernetes manifests [In progress]
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.
We are looking for contributors!
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
Compile a new commit0 binary in the working directory
make build
Now you can either add your project directory to your path or just execute it directly
mkdir tmp
cd tmp
../commit0 create test-app
cd test-app
../../commit0 generate -c commit0.yml
The project is built with GoLang and requires Docker
- /cmd - the CLI command entry points
- /internal/generate
- /internal/config
- /internal/templator - the templating service
Example Flow:
The application starts at cmd/generate.go
- loads all the templates from packr
- TODO: eventually this should be loaded remotely throug a dependency management system
- loads the config from the commit0.yml config file
- based on the configs, run the appropriate generators
- templator is passed in to the Generate function for dependency injection
- each generator (
react/generate.go,ci/generate.goetc) further delegates and actually executes the templating based on the configs passed in.
internal/templator/templator.gois the base class and includes generic templating handling logic- it CI is required, it'll also call a CI generator and pass in the service specific CI configs
- TOOD: CI templates have to call separate templates based on the context
- TODO: templator should be generic and not have any knowledge of the specific templating implementation (go, ci etc), move that logic upstream
- Depending on the config (
deploy == truefor certain) it'll also run theExecutefunction and actually deploy the infrastructure
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 -it -v "$(pwd):/project" commit0:v0'
In order to use this you need ensure you have these installed.
- protoc
- protoc-gen-go [Go]
- protoc-gen-web [gRPC Web]
- protoc-gen-gateway [Http]
- protoc-gen-swagger [Swagger]