mdlr
mdlr copied to clipboard
MDLR ("Modular") gives you declarative and easy Git 'submodules without the pain of submodules'
Mdlr Tool for Git Dependencies
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 directorymdlr initmdlr add --name depname --path deps/mydep --url https://github/org/mydep.gitmdlr 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 commandmdlr list # List the modulesmdlr status # Get the status overviewmdlr update -f # Reset the module forcefully (wipe changes, if any) and then update it and write the new update to the mdlr.yml filevim 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 overviewinit: generate a mdlr.yml file in the directorylist: list the current modulesadd: add a module to the mdlr.yml fileremove: remove a moduleimport: import a moduleupdate: update a modulestatus: 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/mdlrdep ensure -v # Set to verbose to track the progress as this might take a while...
Build the code (for dev platform)
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 buildORgo 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 installwhich (if your$GOPATH/binis in your$PATH) will create a globally-accessibletools-mdlrbinary that you can use to easily test a 'dev' version of your code anywhere on your dev system withtools-mdlr
Distribution
Build the distribution binaries
./xplatform-build.sh- See the output binaries in the
./builddirectory!
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
