Backend for developer collaboration service
For running or testing all services you can use Docker. You can see instructions for installation
here.
After installation you should init swarm
docker swarm init For running or testing all services you can use Python environment. You can install Python on
your local machine directly (see here) or use any wrappers
(venv, pyenv, pipenv, etc.).
Python version: 3.12 or higher
After installation Python you need install poetry (v1.8.2):
pip install poetry==1.8.2And install all Python requirements:
poetry install --all-extrasFor testing you should build full image
docker build -t collabry --target full . Lint
docker run collabry pylint collabry autotests testsIsort
docker run collabry isort .Unit tests
docker run collabry pytest testsAutotests
docker run collabry pytest autotestsLint
pylint collabry autotests testsIsort
isort --check .Unit tests
pytest testsAutotests
pytest autotestsCopy .env.example to .env
cp .env.example .envFor running you should build app image
docker build -t collabry --target slim .Create secrets (you can get any values from .env.example)
echo "any_client_id" | docker secret create oauth2_habr_client_id -
echo "any_client_secret" | docker secret create oauth2_habr_client_secret -
echo "any_api_key" | docker secret create habr_api_key -
echo "any_api_key" | docker secret create habr_career_api_key -
echo "any_access_private_key" | docker secret create jwt_access_token_private_key -
echo "any_access_public_key" | docker secret create jwt_access_token_public_key -
echo "any_refresh_private_key" | docker secret create jwt_refresh_token_private_key -
echo "any_refresh_public_key" | docker secret create jwt_refresh_token_public_key -And run
docker stack deploy -c docker-compose.yaml collabryWait when all services will be running, you can check it by docker service ls.
Join to collabry service
docker exec -it $(docker ps -q -f name=collabry_app) bashApply migrations
poetry run python -m collabry database migrations applyApply fixtures
poetry run python -m collabry database fixtures apply storage autotests