-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgitlab_repo_new
executable file
·47 lines (37 loc) · 947 Bytes
/
gitlab_repo_new
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env ruby
require 'Gitlab'
require 'fileutils'
require_relative 'gitlab.rb'
gitlab_init
if ARGV.length < 1
puts "Usage:"
puts "\tgitlab_repo_rm <name>"
exit 2
end
repo_name = ARGV[0]
#if not repo_name =~ /^wkoszek/
# repo_name = "wkoszek/" + repo_name
#end
options = {}
repo_desc = "desc"
options = {}
options[:description] = repo_desc
options[:default_branch] = "master"
options[:wiki_enabled] = 0
options[:wall_enabled] = 0
options[:issues_enabled] = 0
options[:snippets_enabled] = 0
options[:merge_requests_enabled] = 0
options[:public] = 0
puts "# options"
puts options
Gitlab.create_project(repo_name, options)
FileUtils.mkdir(repo_name)
File.write("#{repo_name}/README.md", "# #{repo_desc}")
Dir.chdir("#{repo_name}")
`git init`
`git remote add origin git@gitlab.com:wkoszek/#{repo_name}.git`
`git add README.md`
`#{ENV['HOME']}/r/tools/git_author_start`
`git commit -m "#{repo_desc}"`
`git push -u origin master`