This is a workspace management tool with the ability to create, version, and combine projects.
This tool sets up directories in your project with a standardized format of:
dev/a workspace to house active development.
stable/a space to hold the latest complete version.
versions/a directory of historical versions.
It provides tools to synchronize files between those directories:
-sSynchronizes the active versions by pulling
-aArchives the current
stable/version into a date-stamped directory under
It also provides tools to compose projects together:
-uUpgrades the project by downloading dependencies into the
dev/directory (without overwriting sensitive files).
-fFull upgrade which acts like
-ubut overwrites all files with the versions from the dependency source.
trt.sh script into your empty project directory.
wget https://raw.githubusercontent.com/moonbench/turret/master/trt.sh && chmod +x trt.sh
Making a new workspace
./trt.sh -i to initialize the workspace.
This will create the empty directories, initialize git repositories, and create default configuration files.
After the project workspace has been initialized you can enter the
dev/ folder and begin development. An empty git repository is provided here which you can commit changes to as you work.
When the code is in a working state, use
./trt.sh -s to synchronize the folders.
This will push the
dev/ repository to the project's shared repository, then pull it down into
After this, the
stable/ code can be shared or linked against, while development continues in the
Archive the current version
If you wish to save the current working version for future reference, run
trt.sh -a to create an archive.
This will create a new directory under
versions/ for the current date (ex:
versions/20180108/) and then copy the contents of
stable/ into the new versioned directory.
This can be useful if you want to have a specific version to be used as a component of another project, or to be referenced externally (such as in a blog post or article).
First, add paths for the dependencies to the
.trt/repos file. This file is automatically created during initialization.
./trt.sh -u to upgrade the project. This will download files from the dependencies into the
repos file might look like:
/home/username/workshop/php_framework/stable /home/username/workshop/upload_tool/versions/20171215 /home/username/workshop/shopping_cart/stable
You can redirect the location where a repo is copied by adding a
> followed by a path.
/home/user/workshop/project/stable > src/modules/js
would have the contents copied into
If you want to prevent a file from being overwritten during future upgrades, add the relative path to the file to the
ignores file might look like:
Optionally, you can run
./trt.sh -f to execute a "Full Upgrade" which will overwrite all files with the versions from the dependencies. Effectively ignoring the
ignores list. This is intended to be used during major version upgrades in dependencies which require manual intervention to repair. The git history can be used to restore specific files.
This tool was built to help manage workspaces while developing software projects.
There were two goals:
Provide the ability to establish versions of a project to share with clients and contributors. By establishing versions, it is possible to have a
dev/workspace where projects can be continuously developed without affecting the
stable/or named versions linked elsewhere. This makes it possible to use, or get feedback on, a known version of the project without requiring the developer to pause their work.
Provide the ability to compose projects into larger projects. By combining projects, it is possible to build smaller isolated projects and then reuse them in other projects. As the individual components change over time the composition can be upgraded to pull in the latest versions. This can be used, for example, to combine existing components such as a web framework, modules, and custom code into a complete website.
You can find additional details on http://moonbench.xyz/projects/turret