Note: you can check the Quickstart guide for list of commands that can quickly get you going.
git clone git@github.com:3scale/zync.git
To run Zync you need access to a running PostgreSQL server. You can install one with your operating system package manager, as a container or run it remotely.
The minimum requirement for the machine running Zync is to have
- Ruby 3.3
psqlclient tool - needed when running fordb:setuplibpq-devel- needed to buildpggem duringbundle install.
You may have to adjust config/database.yml or DATABASE_URL environment variable, see below.
There is a setup script to install gem dependencies,
seed the database and run Zync server.
./bin/setup
Make sure to edit configuration or set needed environment variables beforehand. Most important environment variables you can use:
ZYNC_AUTHENTICATION_TOKEN- this one must match your running Porta configurationDATABASE_URL- depending on your PostgreSQL anddatabase.ymlconfiguration, you may want to set this onePROMETHEUS_EXPORTER_PORT- in case you are running other 3scale components likequeand Porta, you may need to set a different port for each of them through this variable to avoid conflict between themPORT- change port where Zync is running (e.g.5000) to avoid conflict with a locally running Porta server or other software, you can also use the-p 5000command line option
When starting Zync, make sure to use a non-conflicting port on your machine
bundle exec rails server -p 5000
When starting que, make sure to set a non-conflicting Prometheus port
PROMETHEUS_EXPORTER_PORT=9395 bundle exec rake que
The project uses Qlty for checking code quality (e.g. linting, code smells, style, complexity etc.). The new PRs will be automatically checked by Qlty, but you can also run the checks locally on your branch using:
qlty check
qlty smells
These commands will fetch issues in the changed files. To run the complete check on all files, execute:
qlty check --all
qlty smells --all
NOTE: When working on Fedora, the bundled Ruby that is installed for rubocop is broken, see qltysh/qlty#2503. The current workaround is to export this environment variable (which forces compiling Ruby from source instead of installing a binary):
export QLTY_FEATURE_RUBY_BINARY_INSTALL=false