如何从命令行创建gitlab项目

时间:2019-08-09 13:05:07

标签: git curl gitlab gitlab-api

我有一个项目,我使用如下所示的curl创建github存储库

#!/bin/bash

# Create new github repo from the command line.
# Gather constant vars

# usage=> ./create.sh "name" "account" "token"

GITHUBUSER=$2
TOKEN=$3
NAME=$1
DESC="Blog of ${1}"


curl -s -u "${GITHUBUSER}:${TOKEN}" https://api.github.com/user/repos -d "{\"name\": \"${NAME}\", \"description\": \"${DESC}\", \"private\": false, \"has_issues\": true, \"has_downloads\": true, \"has_wiki\": false, \"has_pages\": true}"

# echo "done"
def create_github_repo()
   # new project repo on github
   system("cd scripts && chmod +x ./create.sh")
   system("cd scripts && ./create.sh #{self.username} #{Rails.configuration['gitusername']} #{ENV['token']}")
 end

我尝试移植到gitlab,相应的gitlab curl命令是什么?

0 个答案:

没有答案