Git Product home page Git Product logo

development-tools's Introduction

READ THIS FIRST

SERIOUS, IRREVERSIBLE DAMAGE CAN BE DONE WITH THIS TOOL TO YOUR ENVIRONMENT AND DATABASES. USE FOR EXPERT DEVELOPERS ONLY. USE AT OWN RISK.

Disclaimer

VIKTOR B.V. PROVIDES THIS SOFTWARE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Viktor Development Tools

This repository is a collection of tools to make life easier for VIKTOR-developers. Some important features include:

  • Copy entities: Copy entities from your production environment to your development environment for debugging
  • Stash database and stash database apply: Allows for working on multiple apps simultaneously, without having to set all parametrizaiton manually.

Installation

We have created a pip-installable package that will download the necessary dependencies for you. This will also create a CLI executable (dev-cli).

The current implementation of the cli has been tested on both Windows and Linux. Tested and working for Python versions 3.8 up to 3.11.

Pip-installing from GitHub

Recommended to create a virtual environment. Navigate to desired installation map. For example:

C:\WORK\PYTHON

Create virtual envrironment

python -m venv venv

Activate virual environment

venv\Scripts\activate

Pip install directly from the repository:

pip install git+https://github.com/viktor-platform/development-tools.git@main

Using the Development Tools

To use the tools/scripts in this repository, you can simply call:

dev-cli -h

which looks something like this:

Usage: dev-cli [OPTIONS] COMMAND [ARGS]...

  This is the development tools command line interface.

  It contains the help explanation of all subcommands that are available.

Options:
  -h, --help  Show this message and exit.

Commands:
  copy-entities      Copy entities between domains.
  download-entities  Download entities from domains.
  stash-database     Stashes the database from some domain, and applies it...
  upgrade            Upgrade the cli dependencies.

The -h option should provide enough help for each of the available commands.

Copy entities

Copies entities from source workspace to destination workspace, for example from production to development environment.

Please be careful, all entities are OVERWRITTEN. Wrong use of this functionality can do IRREVERSIBLE DAMAGE to your database, for example when you accidently overwrite your production database with your development database.

Sample use for copying entities:

dev-cli copy-entities -u [email protected] -s demo -si 2895 -di 3032 -sw 120 -dw 55

Note: Make sure that the root entities are similar. This can be achieved by running the app you are trying to copy in your development environment.

Download entities

Download entities to a local file folder.

Sample use for downloading entities:

dev-cli download-entities -s demo -d C:\WORK\PYTHON\download_map -u [email protected] -etn 'Projects' -sw 55

Stash database

Stash database and apply database for later use.

Please be careful, all entities are OVERWRITTEN. Wrong use of this functionality can do IRREVERSIBLE DAMAGE to your database, for example when you accidently overwrite your production database with your development database.

Sample use for stashing the database:

dev-cli stash-database -u [email protected] -s demo -d C:\WORK\PYTHON\download_map -f dev-environment.json -sw 55

Please note: Make sure you have an instance of the app running in your development environment when you stash the database.

Sample use for applying the stashed database:

dev-cli stash-database -u [email protected] -s demo -d C:\WORK\PYTHON\download_map -f dev-environment.json -sw 55 --apply

Please note: Make sure you have an instance of the app running in your development environment when you apply the database.

Limitations

  • Storage() is currently not supported
  • Creating root entity is not possible
  • Non-EU currently not supported

development-tools's People

Contributors

jjvandenberg1 avatar maartenbw avatar mslootwegviktor avatar

Stargazers

Rense Klinkenberg avatar  avatar Enrique García Méndez avatar

Watchers

 avatar

development-tools's Issues

Check entity_id updating after stash database apply

In update_id_on_entity_fields

Ran into an error where the algorithm expected a dict, but got a list. Probably becuase it ran into a DynamicArray or Table in the params.

I fixed this issue for now by checking if the variable is an dict,

Fix login flow copy-entities

fix get_consolidated_login_details

  • also copy username when source and destination are identical
  • first ask for username before password

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.