Skip to main content

Easily creation of pre-production and production scripts to automete your deployment

Project description

PreProd PyPI - Downloads Tests

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

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

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

In calories_tracker/build add the next code

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

preprod calories_tracker build

You'll see in console

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

preprod-1.2.0.tar.gz (27.4 kB view details)

Uploaded Source

Built Distribution

preprod-1.2.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file preprod-1.2.0.tar.gz.

File metadata

  • Download URL: preprod-1.2.0.tar.gz
  • Upload date:
  • Size: 27.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.4 Linux/6.10.0-gentoo

File hashes

Hashes for preprod-1.2.0.tar.gz
Algorithm Hash digest
SHA256 d9b3a2b65af51715b535090be379021ba19b66325ba571768cdddc7c4263ccfc
MD5 de935d1759f33387b4466b3853120ef6
BLAKE2b-256 ab2270c6bdee698090a438c6b055fd4fdaf3bee19674d05dfab1d239da538c52

See more details on using hashes here.

File details

Details for the file preprod-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: preprod-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.4 Linux/6.10.0-gentoo

File hashes

Hashes for preprod-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69a39e940f0f3eae7c06116de006f2016f8badcebdb1c581a85681949cd793a1
MD5 52634d12a2972332c9310e76e557f980
BLAKE2b-256 a18332f6255d111f7dad0944ebfe6e88750ebbc60de5c314239679bbd2a88ccd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page