ackerr / lab Goto Github PK
View Code? Open in Web Editor NEWA command-line tool for gitlab
License: MIT License
A command-line tool for gitlab
License: MIT License
0.x 开头的话,给用户不够正式的错觉
其实这个项目应该已经挺好用的了?
support lab clone --prefix be/inf
and multi-select with fzf to clone
➜ ~ lab config
open config.toml: no such file or directory
Would be very useful to be added to the project, here is an example of fetching Project Variables from the API in Ruby (supporting a hardcoded max of 2 paginated pages of variables at 100 per page).
It's nice to group variables by 'environment_scope', and do an alphabetical sort for presentation.
#!/usr/bin/env ruby
require 'net/http'
require 'json'
unless defined?(ENV['GITLAB_PERSONAL_TOKEN'])
puts 'GITLAB_PERSONAL_TOKEN required'
exit 1
end
TOKEN=ENV['GITLAB_PERSONAL_TOKEN']
PROJECT_ID=File.read('.gitlab/project_id')
API_ENDPOINT="https://gitlab.com/api/v4/projects/#{PROJECT_ID}/variables"
PER_PAGE=100
def fetch_project_variables_page(page)
uri = URI(API_ENDPOINT + "?per_page=#{PER_PAGE}&page=#{page}")
Net::HTTP.start(uri.host, 443,
:use_ssl => uri.scheme == 'https') do |http|
request = Net::HTTP::Get.new uri
request['PRIVATE-TOKEN'] = TOKEN
response = http.request(request)
project_variables = JSON.parse(response.body)
project_variables
end
end
def print_vars
project_variables = Array.new
page_1 = fetch_project_variables_page(1)
page_2 = fetch_project_variables_page(2)
project_variables = project_variables + page_1
if page_2.count > 99
puts 'real pagination of Gitlab Project Variables should be implemented. exiting'
exit 1
else
project_variables = project_variables + page_2
end
group_by_scope = project_variables.group_by {|x| x['environment_scope']}
group_by_scope.each_pair do |scope,vars|
puts "-----------------------------------------------------------------"
puts scope
puts "-----------------------------------------------------------------"
sorted_vars = vars.sort_by { |v| v['key'] }
sorted_vars.each do |var|
puts "#{var['key']}=#{var['value']}"
end
puts ''
end
end
print_vars
检查本地是否安装 fzf,如果有就直接使用
GitLab 中,有些项目是开启 wiki 的。
对于此类项目,可以使用 git clone https://gitlab.com/group/project.git
来克隆本体,也可以使用 git clone https://gitlab.com/group/project.wiki.git
来克隆 wiki 项目~
希望 sync 的时候可以支持一下 (或者 clone 的时候支持下也行?
Is it possible to use multiple gitlab servers ? using multiple config files o multiple configurations at config.toml ?
希望提供一个命令来快速调到指定的项目目录
lab server
-> cd xx.gitlab.cm/abc/be/server/
the above command on lab v0.2.20 now returns an error. All my project scripts now fail. macOS Big Sur and on Linux. All used to work well until recently. The feature appears to have been removed.
- gitlab.com
- gitlab.lilithgames.com
- be
- davinci
- einstein
- fe
- homepage
比如目录结构是这样的时候,lab clone [email protected]:be/newproject
会自动地放在 $CODE/gitlab.lilithgames.com/be/newproject
里
(这样也跟 gopath 里的结构是一样的
if there are 4 repo:
core/user
core/server
core/deploy
my/user
i want to use something like lab clone core/
to clone all repo in group
参考下https://github.com/paulirish/git-open/blob/master/git-open
目前 subpage 会使用 gitlab 风格,加上 /-/
,
但是 gitea 没有中间的这一横…
举例,一个 merge requests subpage 的例子是 https://try.gitea.io/CodingDoctor/for-gitea-issue-8299/pulls
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.