distman
=======
Distributes files and directories to versioned destinations defined in
`dist.json` files.
## Installation
The easiest way to install:
```bash
$ pip install -U distman
```
Alternatively, use distman to dist to a deployment area using options defined
in the `dist.json` and `distman.env` environment stack files:
```bash
$ distman [-d]
```
Files, directories and links can be distributed from any folder or git repo
containing a `dist.json` file.
## Quickstart
`distman` looks for a dist file called `dist.json` at the root of a directory or
git repo. The dist file defines the file distrubution instructions.
The basic format of the `dist.json` file is:
```json
{
"author": "<email>",
"targets": {
"<target>": {
"source": "<source-path>",
"destination": "<target-path>"
},
}
}
```
where `<source-path>` is the relative path to the source file, directory or
link, and `<target-path>` is the target destination path, and `<target>` is a
named target label to use when running `distman` commands. You can define as
many targets as you need.
See the `dist.json` file in this repo for an example.
Target paths can include environment variables, such as those defined in the
`distman.env` envstack file, where variables in paths are defined with curly
brackets only, e.g.:
```bash
"{DEPLOY_ROOT}/lib/python/distman"
```
When files are distributed (or disted), they are copied to a `versions` folder
and a symlink is created to the version. When a new version is disted, the
version number is incremented and the link is updated.
## Usage
To dist files defined in a `dist.json` file (remove -d when ready):
```bash
$ distman -d
```
This will dist files to the `${DEPLOY_ROOT}` folder defined in the provided
`distman.env` [envstack](https://github.com/rsgalloway/envstack) file and might
look something like this when disted:
```
${DEPLOY_ROOT}
├── bin
│ ├── distman -> versions/distman.0.c73fe42
│ └── versions
│ └── distman.0.c73fe42
└── lib
└── python
├── distman -> versions/distman.0.c73fe42
└── versions
└── distman.0.c73fe42
├── cli.py
├── config.py
├── dist.py
├── __init__.py
├── logger.py
├── source.py
└── util.py
```
To override the deployment folder, update the `distman.env` environment stack
file then re-dist:
```bash
$ distman [-d]
```
By default, `distman` dists to a prod folder under `${DEPLOY_ROOT}`. This can be
changed at any time using `${ENV}` or updating or modifying the `distman.env`
envstack file:
```bash
$ ENV=dev distman [-d]
```
This will change `prod` to `dev` in the target deplyment path. This is useful
for deploying files or code to different development environments.
## Dist Info
When disting files, `distman` will create hidden dist info files that meta data
about the source files. For example, if the source file is called `foobar.py`
then the dist info file that will be created will be called `.foobar.py.dist`.
The dist info files will be created at the deployment root.
## Config
Most configuration is done in the `distman.env`
[envstack](https://github.com/rsgalloway/envstack) file.
Default config settings are in the config.py module. The following environment
variables are supported:
| Variable | Description |
|--------------|-------------|
| $DEPLOY_ROOT | file deployment root directory |
| $ENV | target environment (e.g. prod or dev) |
| $ROOT | dist root directory |
Raw data
{
"_id": null,
"home_page": "http://github.com/rsgalloway/distman",
"name": "distman",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Ryan Galloway",
"author_email": "ryan@rsgalloway.com",
"download_url": "https://files.pythonhosted.org/packages/a0/a8/afe6a6919477eb4cb56dc1e33ba82c26591a2633d77874e24cd9fe9cd7e0/distman-0.3.4.tar.gz",
"platform": null,
"description": "distman\n=======\n\nDistributes files and directories to versioned destinations defined in\n`dist.json` files.\n\n## Installation\n\nThe easiest way to install:\n\n```bash\n$ pip install -U distman\n```\n\nAlternatively, use distman to dist to a deployment area using options defined\nin the `dist.json` and `distman.env` environment stack files:\n\n```bash\n$ distman [-d]\n```\n\nFiles, directories and links can be distributed from any folder or git repo\ncontaining a `dist.json` file.\n\n## Quickstart\n\n`distman` looks for a dist file called `dist.json` at the root of a directory or\ngit repo. The dist file defines the file distrubution instructions.\n\nThe basic format of the `dist.json` file is:\n\n```json\n{\n \"author\": \"<email>\",\n \"targets\": {\n \"<target>\": {\n \"source\": \"<source-path>\",\n \"destination\": \"<target-path>\"\n },\n }\n}\n```\n\nwhere `<source-path>` is the relative path to the source file, directory or\nlink, and `<target-path>` is the target destination path, and `<target>` is a\nnamed target label to use when running `distman` commands. You can define as\nmany targets as you need.\n\nSee the `dist.json` file in this repo for an example.\n\nTarget paths can include environment variables, such as those defined in the\n`distman.env` envstack file, where variables in paths are defined with curly\nbrackets only, e.g.:\n\n```bash\n\"{DEPLOY_ROOT}/lib/python/distman\"\n```\n\nWhen files are distributed (or disted), they are copied to a `versions` folder\nand a symlink is created to the version. When a new version is disted, the\nversion number is incremented and the link is updated.\n\n## Usage\n\nTo dist files defined in a `dist.json` file (remove -d when ready):\n\n```bash\n$ distman -d\n```\n\nThis will dist files to the `${DEPLOY_ROOT}` folder defined in the provided\n`distman.env` [envstack](https://github.com/rsgalloway/envstack) file and might\nlook something like this when disted:\n\n```\n${DEPLOY_ROOT}\n\u251c\u2500\u2500 bin\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 distman -> versions/distman.0.c73fe42\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 versions\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 distman.0.c73fe42\n\u2514\u2500\u2500 lib\n \u2514\u2500\u2500 python\n \u251c\u2500\u2500 distman -> versions/distman.0.c73fe42\n \u2514\u2500\u2500 versions\n \u2514\u2500\u2500 distman.0.c73fe42\n \u00a0\u00a0 \u251c\u2500\u2500 cli.py\n \u00a0\u00a0 \u251c\u2500\u2500 config.py\n \u00a0\u00a0 \u251c\u2500\u2500 dist.py\n \u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n \u00a0\u00a0 \u251c\u2500\u2500 logger.py\n \u00a0\u00a0 \u251c\u2500\u2500 source.py\n \u00a0\u00a0 \u2514\u2500\u2500 util.py\n```\n\nTo override the deployment folder, update the `distman.env` environment stack\nfile then re-dist:\n\n```bash\n$ distman [-d]\n```\n\nBy default, `distman` dists to a prod folder under `${DEPLOY_ROOT}`. This can be\nchanged at any time using `${ENV}` or updating or modifying the `distman.env`\nenvstack file:\n\n```bash\n$ ENV=dev distman [-d]\n```\n\nThis will change `prod` to `dev` in the target deplyment path. This is useful\nfor deploying files or code to different development environments.\n\n## Dist Info\n\nWhen disting files, `distman` will create hidden dist info files that meta data\nabout the source files. For example, if the source file is called `foobar.py`\nthen the dist info file that will be created will be called `.foobar.py.dist`.\nThe dist info files will be created at the deployment root.\n\n## Config\n\nMost configuration is done in the `distman.env`\n[envstack](https://github.com/rsgalloway/envstack) file.\n\nDefault config settings are in the config.py module. The following environment\nvariables are supported:\n\n| Variable | Description |\n|--------------|-------------|\n| $DEPLOY_ROOT | file deployment root directory |\n| $ENV | target environment (e.g. prod or dev) |\n| $ROOT | dist root directory |\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Super simple file distribution",
"version": "0.3.4",
"project_urls": {
"Homepage": "http://github.com/rsgalloway/distman"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a0a8afe6a6919477eb4cb56dc1e33ba82c26591a2633d77874e24cd9fe9cd7e0",
"md5": "b141b8f35dbeeaaf66f773d71cdab3bc",
"sha256": "517b5ef4a6c5efc58f720744af43d14e6cb6b368b9f3efa09b430fa2fc652f1a"
},
"downloads": -1,
"filename": "distman-0.3.4.tar.gz",
"has_sig": false,
"md5_digest": "b141b8f35dbeeaaf66f773d71cdab3bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 22411,
"upload_time": "2024-12-21T17:15:10",
"upload_time_iso_8601": "2024-12-21T17:15:10.056070Z",
"url": "https://files.pythonhosted.org/packages/a0/a8/afe6a6919477eb4cb56dc1e33ba82c26591a2633d77874e24cd9fe9cd7e0/distman-0.3.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-21 17:15:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rsgalloway",
"github_project": "distman",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "envstack",
"specs": [
[
"==",
"0.7.3"
]
]
},
{
"name": "gitdb",
"specs": [
[
"==",
"4.0.11"
]
]
},
{
"name": "GitPython",
"specs": [
[
"==",
"3.1.43"
]
]
},
{
"name": "smmap",
"specs": [
[
"==",
"5.0.1"
]
]
}
],
"lcname": "distman"
}