プロジェクトのメンバーの取得
get_members.sh
#
# get_mbembers.sh
#
#
#
FILE_JSON="tmp01.json"
TOKEN="glpat-xxxxxxx"
PROJECT_ID="35195199"
LIMIT="?page=1&per_page=10"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}"/members"${LIMIT}
#
rm -f ${FILE_JSON}
http $URL "PRIVATE-TOKEN:"${TOKEN} > ${FILE_JSON}
#
jq ".[] | { id : .id, username: .username, name : .name, web_url : .web_url, created_at : .created_at }" ${FILE_JSON}
#
プロジェクトのブランチの取得
get_branches.sh
#
# get_branches.sh
#
#
#
FILE_JSON="tmp02.json"
TOKEN="glpat-xxxxxx"
PROJECT_ID="35195199"
LIMIT="?page=1&per_page=10"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}"/repository/branches"${LIMIT}
#
rm -f ${FILE_JSON}
http $URL "PRIVATE-TOKEN:"${TOKEN} > ${FILE_JSON}
#
jq ".[] | {name : .name, merged : .merged, author_name: .commit.author_name}" ${FILE_JSON}
#
プロジェクトの削除
参考情報
Delete project
TOKEN="glpat-xxxxxx"
PROJECT_ID="35195199"
URL="https://gitlab.com/api/v4/projects/"${PROJECT_ID}
#
http DELETE $URL "PRIVATE-TOKEN:"${TOKEN}