We're stoked to announce the release of the new JFrog Source Integration for CloudQuery. The integration allows you to extract raw JFrog data, load it to any supported destination and gain actionable insights.
New JFrog Source Integration
The new integration can get information from your JFrog instance - from projects, repositories, users, to individual build run information. Take a look at the JFrog Integration documentation. You can gain insights into your data and go through it in any way you prefer.
Setting up
Here is a step-by-step guide on how to configure the JFrog Source integration and use the collected data.
- Obtain your token Start by getting the token used for accessing your JFrog instance. For this, either access or identity tokens can be used.
- Install CloudQuery CLI Download and install the CloudQuery CLI on your machine by following steps on our download page.
- Set up the Sync Configuration Create a CloudQuery configuration file by running the following init command. You can use any supported destination, for this example, we will use PostgreSQL:
cloudquery init --source=jfrog --destination=postgresql
This command will create a jfrog_to_postgresql.yaml file in your current directory. - Update the Configuration File: Open the generated config file and replace the placeholders:
${JFROG_INSTANCE_URL} with the base URL to your instance (a local instance would be http://localhost:9000 )${JFROG_ACCESS_TOKEN} with the token generated in step 1.${POSTGRESQL_CONNECTION_STRING} with connection string to your PostgreSQL database.
- Sync with CloudQuery:
For more details, refer to the SonarQube Source Integration documentation.
Example Queries
Get the latest build run info for all builds within a given project.
WITH latest_builds AS (
SELECT
jbr.build_name,
MAX((jbr.build_info->>'started')::timestamp) AS latest_started
FROM
jfrog_build_run_info jbr
GROUP BY
jbr.build_name
)
SELECT
jbb.build_name,
jbb.project_key,
jbr.build_info
FROM
jfrog_builds jbb
JOIN
latest_builds lb
ON
jbb.build_name = lb.build_name
JOIN
jfrog_build_run_info jbr
ON
jbb.build_name = jbr.build_name
AND (jbr.build_info->>'started')::timestamp = lb.latest_started
WHERE
jbb.project_key = 'your_project_key';
Get average builds per day for every build within a project
WITH build_dates AS (
SELECT
jbb.project_key,
jbr.build_name,
(jbr.build_info->>'started')::date AS build_date
FROM
jfrog_builds jbb
JOIN
jfrog_build_run_info jbr
ON
jbb.build_name = jbr.build_name
WHERE
jbb.project_key = 'your_project_key'
)
SELECT
project_key,
build_name,
AVG(build_count) AS average_builds_per_day
FROM (
SELECT
project_key,
build_name,
build_date,
COUNT(*) AS build_count
FROM
build_dates
GROUP BY
project_key, build_name, build_date
) daily_builds
GROUP BY
project_key, build_name
ORDER BY average_builds_per_day DESC;
Want to see CloudQuery in action? Schedule a demo with our team or check out the platform documentation to learn more.
Want help getting started? Join the CloudQuery community to connect with other users and experts, or message our team directly here if you have any questions.
Try CloudQuery yourself
Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.