How to find Changeset IDs included in Deployment Versions
目的
This article will show how to find the last Repository Changeset – by commit ID or hash – included in a given deployment version using a SQL query.
ソリューション
To list Changeset IDs for all repository types
SELECT dv.NAME AS "Version",
dp.NAME AS "Deployment Project",
de.NAME AS "Deployment Environment",
dvc.CHANGESET_ID AS "Commit Hash"
FROM DEPLOYMENT_PROJECT dp
JOIN DEPLOYMENT_VERSION dv ON (dp.DEPLOYMENT_PROJECT_ID = dv.PROJECT_ID)
JOIN DEPLOYMENT_VERSION_CHANGESET dvc ON (dv.DEPLOYMENT_VERSION_ID=dvc.DEPLOYMENT_VERSION_ID)
JOIN DEPLOYMENT_ENVIRONMENT de ON (de.PACKAGE_DEFINITION_ID = dp.DEPLOYMENT_PROJECT_ID)
WHERE dv.NAME = '<version name>';
To list only changesets/hashes for one Repository Type
SELECT dv.NAME AS "Version",
dp.NAME AS "Deployment Project",
de.NAME AS "Deployment Environment",
dvc.CHANGESET_ID AS "Commit Hash"
FROM DEPLOYMENT_PROJECT dp
JOIN DEPLOYMENT_VERSION dv ON (dp.DEPLOYMENT_PROJECT_ID = dv.PROJECT_ID)
JOIN DEPLOYMENT_VERSION_CHANGESET dvc ON (dv.DEPLOYMENT_VERSION_ID=dvc.DEPLOYMENT_VERSION_ID)
JOIN DEPLOYMENT_ENVIRONMENT de ON (de.PACKAGE_DEFINITION_ID = dp.DEPLOYMENT_PROJECT_ID)
JOIN VCS_LOCATION vl ON (dvc.VCS_LOCATION_ID = vl.VCS_LOCATION_ID)
WHERE dv.NAME = '<version name>'
AND vl.PLUGIN_KEY = '<plugin key>';
Sample Output
バージョン | Deployment Project | Deployment Environment | Commit Hash |
---|---|---|---|
release-1 | Test Deploy 1 | TestEnv 1 | 115f848562edd456ec110429468272a7dfe92eb4 |
release-1 | Test Deploy 2 | stg | ecbbc9ffe9d9a329bfe28e1bd414102868cf3215 |
release-1 | Test Deploy 3 | デプロイメント | ecbbc9ffe9d9a329bfe28e1bd414102868cf3215 |
最終更新日 2017 年 5 月 25 日
Powered by Confluence and Scroll Viewport.