Last active
August 29, 2015 14:22
-
-
Save heyfletch/af568a27686e560de21d to your computer and use it in GitHub Desktop.
gitlab-init-remote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Modified from: https://coderwall.com/p/r7yh6g/create-a-new-gitlab-repo-from-the-command-line | |
# to use: | |
## Setup script locally: | |
# download gist (use this node helper: https://www.npmjs.com/package/download-gist) | |
# dg af568a27686e560de21d | |
# First, replace MyGitlabToken from https://gitlab.com/profile/account | |
# chmod +x gitlab-init-remote | |
# mv gitlab-init-remote /usr/local/bin/gitlab-init-remote | |
# To use: | |
# gitlab-init-remote my-cool-repo | |
repo=$1 | |
token=MyGitlabToken | |
test -z $repo && echo "Repo name required." 1>&2 && exit 1 | |
curl -H "Content-Type:application/json" https://gitlab.com/api/v3/projects?private_token=$token -d "{ \"name\": \"$repo\" }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment