NOTE 🛑 This is a proof of concept application. Before you start using this
tool please talk to the team in the #product-commit0
slack channel so we can
give you better instructions on how to get started.
Status: Proof of Concept
Commit0 is a project skaffolding framework and ecosystem created to:
- Maximize knowledge sharing across an organization
- Easily maintain a state of the art and easily reusable implementations of production grade solutions to recurring problems
- Re-create the seamless deployment experience offered by PaaS solutions but with a fully open source stack that follows industry best practices
With Commit0:
- Easily deploy and integrate various boilerplate solutions
- Instantly integrate commonly used open source microservices for authentication, user management, file encryption, image resizing etc.
- Get a simple Push-To-Deploy workflow that you are accustomed to with popular PaaS solutions [TODO]
- There's no vendor lock-in. It's all implemented with open source tools and deployed to your own cloud provider.
Commit0 CLI is an opinionated, yet fully modular code generation tool with declarative syntax that allows developers to easily integrate user prompts and interactions.
Problems we encountered:
- It was tedious to create reusable templates and hard to maintain
- Lack of standardization and integration interface between the templates
- Difficult to integrate individually templated codebases
How we aim to address those issues:
- Make templating behaviour simple and declarative
- Clear strategy and guideline around what are clear and reusable templates
- Standardize how templated code should get dependent parameters and start up
This is inspired by:
As there some 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" -v "${HOME}/.aws:/root/.aws" commit0:v0'
- To create a project run
commit0 create [PROJECT_NAME]
- It will prompt you to select a cloud provider and an account profile to use
- A folder
PROJECT_NAME
will be created. You cancd [PROJECT_NAME]
and configure the examplecommit0.yml
that's generated - Run
commit0 generate -c <commit0.yml>
to generate all the all the project repos - You can go to each project repo and follow the project readme to start the service
commit0 ui
launches the locally hosted web UI (Static SPA) and the API server
This is a guide on how to configure your project manually with a single file commit0.yml
. Simply write this file to the root of your project directory and run the commit0 CLI tool against it to generate your project files.
Your project config file. It describes the project Example:
name: newProject
context:
cognitoPoolID: xxx
modules:
- source: "github.com/commitdev/commit0-aws-eks-stack"
output: "infrastructure"
- source: "github.com/zthomas/react-mui-kit"
output: "web-app"
Name of your project. This will be used to name the github repos as well as in other parts of the generated code.
Required | True |
Type | String |
A key value map of global context parameters to use in the templates.
Required | False |
Type | Map[String] |
List of modules template modules to import
Required | True |
Type | Map[Module] |
We are using go-getter to parse the sources, we you can use any URL or file formats that go-getter supports.
Required | True |
Type | String |
Module parameters to use during templating
Required | True |
Type | String |
Template output directory that the current module should write to.
Required | False |
Type | String |
Whether to overwrite existing files when generating files from templates
Required | False |
Type | Boolean |
Default | False |
The module config file. You can configure how the templating engine should process the files in the current repository. Example:
name: react-mui-kit
template:
extension: '.tmplt'
delimiters:
- '<%'
- '%>'
output: web-app
Name of your module. This will be used as the default module directory as well as a display name in the prompts.
Required | True |
Type | String |
Short description of the module
Required | False |
Type | String |
Template configurations
Required | False |
Type | Map |
File extension to signify that a file is a template. If this is defined, non-template files will not be parsed and will be copied over directly. The default value is .tmplt
Required | False |
Type | Map |
An pair of delimiters that the template engine should use. The default values are: {{
, }}
Required | False |
Type | Map[String] |
The default template output directory that you want the template engine to write to. This will be overwritten by the
Required | False |
Type | String |
User prompts to generate to collect additional module specific params
Required | False |
Type | Map |
The name of the field that the param should be written to
Required | True |
Type | String |
The message that will be presented to the user
Required | False |
Type | String |
A list of options to select from. If not given, then it will be rendered as a text input prompt.
Required | False |
Type | Map[String] |
We are looking for contributors!
Building from the source
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
To run a single test for development
go test -run TestGenerateModules "github.com/commitdev/zero/internal/generate" -v
As there are some 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'