A compiled CLI tool to help manage a monorepo and automate CI/CD operations.
The documentation is stored under docs/, no PDFs, and the program code is under src.
- Run project targets
- Manage project dependencies
- Manage target execution dependencies
- Detect updated projects
- Search projects
- List registered projects
- Cache target execution output
- Generate json schema for the JSON files
- A wizard to add a project to the workspace
The tool made here is a command line tool targeted at Unix Machines. It is written in Go, so you need to have Go installed on your machine to run the program, You can download it from here. We are using golang version 1.19.5.
The program can be compiled by first navigating to where the source code is located, /src/ and using the command go build
, which should produce a cigo
binary.
You can call ./cigo -h
to get the help output.
./cigo -h
should output the following:
Usage:
cigo [OPTIONS] <command>
Application Options:
-d, --dry Print commands to run in order without running
anything.
-V, --version Print version
Help Options:
-h, --help Show this help message
Available commands:
add-project
create-schema
get-changed
list
run
search
Feel free to add the program to your path.
This repo is already setup with the files that we need to run the program. In the root directory, we have our workspace.json
file which contains information about our workspace. We also have sample projects in the /apps
directory, each setup with their own project.json
files.
Compiling the program:
First navigate to wherever the source code is located.
cd /src/
Use the command go build
to generate the cigo
binary. A new file should appear in your current directory.
go build
You can then use the compiled tool to manage your monorepo.
Creating schemas to test your workspace and project files against:
Let's create JSON schema's that help us validate our workspace and project files. To create these schemas we
call the create-schema
command, passing it the type of schema we want to create (workspace' or
project').
./cigo create-schema workspace
Searching for specific information in the projects of the workspace:
You can search all the projects with key:value pairs by using the following command:
./cigo search mainLanguage:cpp
Listing all the projects in the workspace:
We have a list command that lists all the projects in the workspace:
./cigo list
Getting changes in the workspace:
This command will get all the projects that have been changed since the last commit. You can specify the branch or commit hash and the head commit to compare. If you don't specify -h , it will use the current HEAD commit.
./cigo get-changed -b main -h HEAD
Running a projects Target:
To run a target, you need to specify the project name and the target name. The target is what will be run, as it contains the commands that will be executed.
To specify a project, you need to use the flag -p
or --project
and to specify a target, you need to use the flag -t
or --target
.
./cigo run -p proj_a -t build
The command above would run the build
target in the proj_a
project.
Adding a project to the workspace:
To add a project to the workspace, you can use the add-project
command. It will prompt you with questions regarding the project you want to add, and then will update the workspace and create the project.json
file for you.
./cigo add-project
Extra Information:
If you need more information about the commands, you can use the help flag
./cigo -h
If you need more information about a specific command, you can use the help flag with the command name, for example to get help about the run
command, you can use the following command:
./cigo run -h
- Ahmed Ammar Al-Sabounchi ([email protected])
- Ali Ahmed Khan ([email protected])
- Omar Alkersh ([email protected])
- Tanveer Shakeel ([email protected])
- Usman Asad ([email protected])
There are other products that have the same purpose, but we couldn't find one that does exactly what we wanted to do. The relevant projects are: