Cloudquery News
Announcing the JFrog Source Integration
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.
- 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 ajfrog_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 behttp://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:
- Log in using
cloudquery login
- Run the following command:
cloudquery sync jfrog_to_postgresql.yaml
For more details, refer to the SonarQube Source Plugin 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;
Ready to get insights into your infrastructure? You can download CloudQuery and follow along with our quick start guide, or explore CloudQuery Cloud for a more scalable solution.
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.
Written by Bartosz Leśniewski
Bartosz is a Senior Software Engineer at CloudQuery specializing in Golang code development with over five years of experience in various roles.