Declarative and easy git 'submodules without the pain of submodules.'
In action
Installing
Linux / OS X
To install for linux or OS X systems, please run curl https://s3-us-west-2.amazonaws.com/mdlr-dist/v1/install.sh | bash
Dockerfile-compatible Automated Installer (assumes *nix system, root, non-interactive)
For docker-ized installs or systems where you are in the root shell, please run curl https://s3-us-west-2.amazonaws.com/mdlr-dist/v1/install-root.sh | bash
Windows (Beta support)
Download the .exe
binary for your platform:
From there, you can put the .exe
file where you like and run it from the command line/powershell.
If you have any issues, with the Windows install/functionality, please report them here.
Updating
Please run the install script for your platform above to get the latest updates. For windows users, replace the .exe
binary
Using Mdlr
Example workflow
cd project/directory/ # Enter the project directory
mdlr init
mdlr add --name depname --path deps/mydep --url https://github/org/mydep.git
mdlr import -f # Reset the module forcefully (wipe changes, if any) and then import it at the version in the mdlr.yml file. This is the recommended command
mdlr list # List the modules
mdlr status # Get the status overview
mdlr update -f # Reset the module forcefully (wipe changes, if any) and then update it and write the new update to the mdlr.yml file
vim mdlr.yml # View/edit the mdlr.yml file
Create a new mdlr project
In the project directory, run mdlr init
Import modules for a mdlr project
In the project directory, run mdlr import -f
Update modules for a mdlr project
In the project directory, run mdlr update -f
(that's like doing git pull in each module)
Edit a module and commit it
Go into the submodule directory, make modifications, and commit them.
Then go back to the project root repository, git status
, then git add .
and commit that change. It will commit the latest commit from the submodule.
If there are modified files in the submodule that are not committed, then it's impossible to commit it in the project root repository.
Commands overview
help
: get a help overview
init
: generate a mdlr.yml file in the directory
list
: list the current modules
add
: add a module to the mdlr.yml file
remove
: remove a module
import
: import a module
update
: update a module
status
: get the status for the mdlr.yml or invidual modules
Installing from Source / Developing
Prerequisites
- Ubuntu 16.04 (Server or Desktop) operating system -- other similar systems and OS X might work, but aren't guaranteed to...
- GoLang 1.9.^ installed
- GoLang dependency manager installed (Install guide)
Get the project
go get github.com/exlinc/mdlr
Setting up dep
cd $GOPATH/src/github.com/exlinc/mdlr
dep ensure -v # Set to verbose to track the progress as this might take a while...
go build # Optionally, use go run main.go instead of the build+run flow and your code will compile every time you run with the latest changes
Run the code
./mdlr # Runs the latest output of go build
OR go run main.go # Compiles a temp binary from the latest changes and runs it all in one command
Install the dev binary on your system
- Run
go install
which (if your $GOPATH/bin
is in your $PATH
) will create a globally-accessible tools-mdlr
binary that you can use to easily test a 'dev' version of your code anywhere on your dev system with tools-mdlr
Distribution
Build the distribution binaries
./xplatform-build.sh
- See the output binaries in the
./build
directory!
Uploading to S3 for distribution
The S3 upload is done by the maintainer (EXL Inc.) for new releases to the bucket used in the install scripts.
Contributing
Contributions are welcome and appreciated in the form of issues and pull requests in this repo!
License
MIT