preprod


Namepreprod JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryEasily creation of pre-production and production scripts to automete your deployment
upload_time2024-07-25 04:00:25
maintainerNone
docs_urlNone
authorturulomio
requires_python<4,>=3.11
licenseGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PreProd [![PyPI - Downloads](https://img.shields.io/pypi/dm/preprod?label=Pypi%20downloads)](https://pypi.org/project/preprod/) [![Tests](https://github.com/turulomio/preprod/actions/workflows/python-app.yml/badge.svg)](https://github.com/turulomio/preprod/actions/workflows/python-app.yml)
Easy creation of pre-production and production scripts to automate your deployment

When you're deploying your software in your web server or when you're developing, you often need to modify default settings of your software to addapt them to your needs.

Sometimes, you develop your own scripts to automate this task, but these scripts become more complex each day. That's the reason of this project. PreProd helps you to develop your own deployment script, setting them in a repository.

Preprod uses python code so you don't have to learn any other language.

If your user is root this repository is set in `/etc/preprod` and if your logged as a normal user in `~/.preprod`

Preprod has defined a lot of help commands to make your scripts more visual. They are resumed below and you can call them appending `preprod_commons` python module. Morever you can create your own commands in `{yourrepositorypath}/repository_commons.py` and call them inside your scripts appending `repository_commons` as any other python module.

## Example

For example, We are going to automate e2e test in console using preprod with my frontend project [Calories Tracker](https://github.com/turulomio/calories_tracker/)

First we need to create our PreProd repository. As we said before you can create as root or as a normal user.


```bash
preprod_create_repository
cd /home/your_user/.preprod
mkdir calories_tracker
nano calories_tracker/build
```

In calories_tracker/build add the next code

```python
preprod_commons.chdir("/tmp")
preprod_commons.rmtree("/tmp/calories_tracker_build")
preprod_commons.git_clone("https://github.com/turulomio/calories_tracker", "calories_tracker_build")
preprod_commons.chdir("/tmp/calories_tracker_build")
preprod_commons.npm_install()
preprod_commons.run_and_check("npm run build")
```

Now if you run `preprod` you can see your scripts (project: calories_tracker, action: build). So just run

```bash
preprod calories_tracker build
```
You'll see in console 

<img src="https://raw.githubusercontent.com/turulomio/preprod/main/doc/preprod_example.png" title="PreProd example">

And your calories_tracker build is now in `/tmp/calories_tracker_build/dist` 

If something goes wrong you can see color logs in `/tmp/preprod_logs_your_user/`

I hope you like it and give me a star.

## Commands

You can see all preprod_commons method  [here](doc/PREPROD_COMMANDS.md)


## Changelog

### 1.2.0 (2024-07-25)
- Added branch support to git clone command
- Added number_of_sockets and socket_timeout parameters to nmcli_net_change command

### 1.1.0 (2024-07-03)
- Running system with other user changes before to current working directory
- Added kill_from_ps_aux method

### 1.0.1 (2024-06-29)
- run_and_check allows to add user and password parameters
- system allows to add user parameter

### 0.6.0 (2024-06-23)
- Solved problem creating python virtual environment
- Improving tests procedure. Coverage is now 85% (#42)

### 0.5.0 (2024-06-17)
- Added getuser, rm, create_a_file commands
- Improved preprod parameters experience
- poetry_env_info now returns a tuple with the virtual env python executable and pip executable

### 0.4.0 (2024-06-08)
- Temporal preprod logs are now created by each user to avoid permissions problems
- Added examples and documentation
- Added poe doc command
- Improved parameters errors

### 0.3.0 (2024-05-28)
- Improved description system
- Added makedirs and git clone in different directory
- Improved spanish translations
- Added --version to commands
- Added test with a 84% coverture

### 0.2.0 (2024-05-26)
- Added logs in /tmp/preprod_logs/
- Added chown_recursive, chmod_recursive, rsync, poetry_install, poetry_env_info methods to commons

### 0.1.0 (2024-05-21)
- Basic functionality

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "preprod",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "turulomio",
    "author_email": "turulomio@yahoo.es",
    "download_url": "https://files.pythonhosted.org/packages/ab/22/70c6bdee698090a438c6b055fd4fdaf3bee19674d05dfab1d239da538c52/preprod-1.2.0.tar.gz",
    "platform": null,
    "description": "# PreProd [![PyPI - Downloads](https://img.shields.io/pypi/dm/preprod?label=Pypi%20downloads)](https://pypi.org/project/preprod/) [![Tests](https://github.com/turulomio/preprod/actions/workflows/python-app.yml/badge.svg)](https://github.com/turulomio/preprod/actions/workflows/python-app.yml)\nEasy creation of pre-production and production scripts to automate your deployment\n\nWhen you're deploying your software in your web server or when you're developing, you often need to modify default settings of your software to addapt them to your needs.\n\nSometimes, you develop your own scripts to automate this task, but these scripts become more complex each day. That's the reason of this project. PreProd helps you to develop your own deployment script, setting them in a repository.\n\nPreprod uses python code so you don't have to learn any other language.\n\nIf your user is root this repository is set in `/etc/preprod` and if your logged as a normal user in `~/.preprod`\n\nPreprod has defined a lot of help commands to make your scripts more visual. They are resumed below and you can call them appending `preprod_commons` python module. Morever you can create your own commands in `{yourrepositorypath}/repository_commons.py` and call them inside your scripts appending `repository_commons` as any other python module.\n\n## Example\n\nFor example, We are going to automate e2e test in console using preprod with my frontend project [Calories Tracker](https://github.com/turulomio/calories_tracker/)\n\nFirst we need to create our PreProd repository. As we said before you can create as root or as a normal user.\n\n\n```bash\npreprod_create_repository\ncd /home/your_user/.preprod\nmkdir calories_tracker\nnano calories_tracker/build\n```\n\nIn calories_tracker/build add the next code\n\n```python\npreprod_commons.chdir(\"/tmp\")\npreprod_commons.rmtree(\"/tmp/calories_tracker_build\")\npreprod_commons.git_clone(\"https://github.com/turulomio/calories_tracker\", \"calories_tracker_build\")\npreprod_commons.chdir(\"/tmp/calories_tracker_build\")\npreprod_commons.npm_install()\npreprod_commons.run_and_check(\"npm run build\")\n```\n\nNow if you run `preprod` you can see your scripts (project: calories_tracker, action: build). So just run\n\n```bash\npreprod calories_tracker build\n```\nYou'll see in console \n\n<img src=\"https://raw.githubusercontent.com/turulomio/preprod/main/doc/preprod_example.png\" title=\"PreProd example\">\n\nAnd your calories_tracker build is now in `/tmp/calories_tracker_build/dist` \n\nIf something goes wrong you can see color logs in `/tmp/preprod_logs_your_user/`\n\nI hope you like it and give me a star.\n\n## Commands\n\nYou can see all preprod_commons method  [here](doc/PREPROD_COMMANDS.md)\n\n\n## Changelog\n\n### 1.2.0 (2024-07-25)\n- Added branch support to git clone command\n- Added number_of_sockets and socket_timeout parameters to nmcli_net_change command\n\n### 1.1.0 (2024-07-03)\n- Running system with other user changes before to current working directory\n- Added kill_from_ps_aux method\n\n### 1.0.1 (2024-06-29)\n- run_and_check allows to add user and password parameters\n- system allows to add user parameter\n\n### 0.6.0 (2024-06-23)\n- Solved problem creating python virtual environment\n- Improving tests procedure. Coverage is now 85% (#42)\n\n### 0.5.0 (2024-06-17)\n- Added getuser, rm, create_a_file commands\n- Improved preprod parameters experience\n- poetry_env_info now returns a tuple with the virtual env python executable and pip executable\n\n### 0.4.0 (2024-06-08)\n- Temporal preprod logs are now created by each user to avoid permissions problems\n- Added examples and documentation\n- Added poe doc command\n- Improved parameters errors\n\n### 0.3.0 (2024-05-28)\n- Improved description system\n- Added makedirs and git clone in different directory\n- Improved spanish translations\n- Added --version to commands\n- Added test with a 84% coverture\n\n### 0.2.0 (2024-05-26)\n- Added logs in /tmp/preprod_logs/\n- Added chown_recursive, chmod_recursive, rsync, poetry_install, poetry_env_info methods to commons\n\n### 0.1.0 (2024-05-21)\n- Basic functionality\n",
    "bugtrack_url": null,
    "license": "GPL-3",
    "summary": "Easily creation of pre-production and production scripts to automete your deployment",
    "version": "1.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a18332f6255d111f7dad0944ebfe6e88750ebbc60de5c314239679bbd2a88ccd",
                "md5": "52634d12a2972332c9310e76e557f980",
                "sha256": "69a39e940f0f3eae7c06116de006f2016f8badcebdb1c581a85681949cd793a1"
            },
            "downloads": -1,
            "filename": "preprod-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52634d12a2972332c9310e76e557f980",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.11",
            "size": 31122,
            "upload_time": "2024-07-25T04:00:23",
            "upload_time_iso_8601": "2024-07-25T04:00:23.508815Z",
            "url": "https://files.pythonhosted.org/packages/a1/83/32f6255d111f7dad0944ebfe6e88750ebbc60de5c314239679bbd2a88ccd/preprod-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab2270c6bdee698090a438c6b055fd4fdaf3bee19674d05dfab1d239da538c52",
                "md5": "de935d1759f33387b4466b3853120ef6",
                "sha256": "d9b3a2b65af51715b535090be379021ba19b66325ba571768cdddc7c4263ccfc"
            },
            "downloads": -1,
            "filename": "preprod-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "de935d1759f33387b4466b3853120ef6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.11",
            "size": 27395,
            "upload_time": "2024-07-25T04:00:25",
            "upload_time_iso_8601": "2024-07-25T04:00:25.058036Z",
            "url": "https://files.pythonhosted.org/packages/ab/22/70c6bdee698090a438c6b055fd4fdaf3bee19674d05dfab1d239da538c52/preprod-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-25 04:00:25",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "preprod"
}
        
Elapsed time: 0.28927s