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

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-0.6.0.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

preprod-0.6.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for preprod-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f7971fdf3e48d331229971919d56017cb51ab14e8bca38e3bb8f84bab94cb024
MD5 fdcd7c5aa8ec2f9624888a6c41b97185
BLAKE2b-256 e61bd424cd6381937a1f9e43e2648af4a34683a6d5766b1d4102171ec6de2958

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for preprod-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7bc306be24995950e7a9036626acc3dd57b1edcc325554662e1025a7587ccbb
MD5 e0d51b49b54408505f297d84602c6e5b
BLAKE2b-256 3a4b58715ef267d4e4614bb2aa79aaf2302468469616812d9edb512219440ce8

See more details on using hashes here.

Supported by

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