FourDigits CLI tool
Project description
FourDigits CLI
A command line tool to make development and deployment easier within Four Digits.
It has the following commands:
- "docker"
- "build": Build docker images in our Gitlab CI pipelines
- "gitlab"
- "fix-coverage-paths": Change the generated coverage.xml so Gitlab can show coverage visualization in merge requests
- "exonet"
- "deploy": Deploy a project to Exonet
- "db:download": Download a database from Exonet and import it locally
- "db:copy": Copy a database from one environment to another
- "docker-compose"
- "sync": Sync files from a service to local folder
- "sync:env": Shortcut for django:home/userapp/env -> env-docker
Install
pip install fourdigits-cli
Upgrade
pip install --upgrade fourdigits-cli
Enable auto complete
bash
Add this to ~/.bashrc
:
eval "$(_FD_COMPLETE=bash_source fd)"
eval "$(_FOURDIGITS_COMPLETE=bash_source fourdigits)"
Zsh
Add this to ~/.zshrc
:
eval "$(_FD_COMPLETE=zsh_source fd)"
eval "$(_FOURDIGITS_COMPLETE=zsh_source fourdigits)"
Usage
After installation the cli tool is available under fourdigits
and fd
.
For more information use:
fourdigits --help
Project configuration
The project is configured in the pyproject.toml
file, available options and their defaults:
[project]
name = "default-project"
[tool.fourdigits]
exonet_project_name="<default is project name>"
docker_repo="<default is project name>"
slack_channel="<default is project name>"
docker_image_user="fourdigits"
[tool.fourdigits.envs.<environment anem>]
exonet_environment="<default is environment name>"
# Every setting can be overridden per environment
slack_channel="custom-channel"
Example project with seperate nextjs
[project]
name = "django-project"
[tool.fourdigits]
# default to project name
[tool.fourdigits.envs.tst]
[tool.fourdigits.envs.acc]
[tool.fourdigits.envs.prd]
[tool.fourdigits.envs.nextjs_tst]
exonet_project_name = "nextjs"
exonet_environment = "tst"
docker_repo = "nextjs"
[tool.fourdigits.envs.nextjs_acc]
exonet_project_name = "nextjs"
exonet_environment = "acc"
docker_repo = "nextjs"
[tool.fourdigits.envs.nextjs_prd]
exonet_project_name = "nextjs"
exonet_environment = "prd"
docker_repo = "nextjs"
Development
make develop
Releasing
To make a new release available on pypi, follow these steps:
- Update version by edit
fourdigits_cli/__init__.py
and commit. - Run:
make push-version
- Update the installation of fourdigits-cli in https://gitlab.com/fourdigits/utils/docker-pipeline-image/-/blob/main/Dockerfile to the newest version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fourdigits-cli-1.15.0.tar.gz
(12.6 kB
view hashes)
Built Distribution
Close
Hashes for fourdigits_cli-1.15.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ed43959fdb86bd611846d6b906eb1a778a89c36bed82dcd0886bf576ad8450 |
|
MD5 | 407547aff37c0bcb396da29589f991eb |
|
BLAKE2b-256 | 005e7ac9e831842d8db3a8e1fc508208033be8e619047440bd8162ccfaefcf28 |