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.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.5.0.tar.gz (24.5 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.5.0-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for preprod-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4a22169f6f6a38ff6b40e0229358ce04c8acf6947ce62a8ffa89f3f3a315dc1a
MD5 676312ca5353fc705cb49793fa58fffe
BLAKE2b-256 a57fd78b0adab0faa4ce7bc76d214072330b444ae6ecad93f83d79f0767e3e40

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for preprod-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68a43ac9d14e430e5c23aab26457de0bcdd264a99c04bdbfa90a01996c3a2715
MD5 d8595622d67d7bba15fa02dddecca6b1
BLAKE2b-256 9f7ca27cc0f73b564af0b5155b76701cbdc638d2cf87ef3133792353191e93f6

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