How to create a gitlab project from terminal or command line

后端 未结 2 500
太阳男子
太阳男子 2020-12-18 11:40

I have internal setup gitlab server. I want to run separate ant script and create a project in that gitlab server. (without creating new project in gitlab UI)

In the

2条回答
  •  别那么骄傲
    2020-12-18 12:07

    Would would need to use the GitLab API to create a project

    POST /projects
    

    One of the optional parameters is:

    visibility_level (optional):

    • 0 is Private (Project access must be granted explicitly for each user)
    • 10 is Internal (The project can be cloned by any logged in user),
    • 20 is Public (The project can be cloned without any authentication)

    Using a private token (and jq):

    curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" \
    -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -X POST 
    --data-urlencode 'name=myproject' \
    --data-urlencode 'visibility_level=0' \
    "http://example.com/api/v3/projects"
    

提交回复
热议问题