剛好碰到需要製作 Gitlab 整合類服務,開發完後就把很基礎的項目整理成小工具來支援 JSON 輸出,未來可以跟 jq 做一堆連續技:
用法:
% virtualenv venvcreated virtual environment CPython3.11.5.final.0-64 in 120ms...% source venv/bin/activate(venv) %(venv) % pip3 install gitlab-api-helper(venv) % ./venv/bin/gitlab-api-helper{"info": ["config file not found: .env","--api empty"],"result": null,"version": "1.0.0"}usage: gitlab-api-helper [-h] [--apiSetupConfig APISETUPCONFIG][--apiAccessToken APIACCESSTOKEN] [--api API][--sinceType {day,week,month}][--sinceNumber SINCENUMBER][--lookup {project,branch,commit}][--lookupProjectID LOOKUPPROJECTID][--lookupBranch LOOKUPBRANCH]A Simple Tool for Gitlab API Usageoptions:-h, --help show this help message and exit--apiSetupConfig APISETUPCONFIGRead Default Info from config file--apiAccessToken APIACCESSTOKENUsing Gitlab API with private_token.--api API Gitlab API URL--sinceType {day,week,month}commit date range type--sinceNumber SINCENUMBERcommit date range value--lookup {project,branch,commit}query result--lookupProjectID LOOKUPPROJECTIDGitlab Project ID--lookupBranch LOOKUPBRANCHBranch Name
剩下就看 github.com/changyy/gitlab-api-helper 或 pypi.org/project/gitlab-api-helper/ 的簡介囉
沒有留言:
張貼留言