https://docs.gitlab.com/ee/api/repositories.html

curl --header "PRIVATE-TOKEN: fxhDXPRJAowCouXEobrz" "http://localhost/api/v4/repositories"

curl --header "PRIVATE-TOKEN: W72WXtZCW6hGmyPT_meU" "http://git.unipus.cn/api/v4/projects"

_这个地址访问获取的项目数量是20个,最后一下项目的显示下标是19,之所以没有展示完所有项目,是因为gitlab api默认做了分页处理,如果不建入分页参数,会默认只显示20条,用下面的地址访问,就可以显示更多项目了:
https://git.ynpay.cc/api/v3/projects/all?per_page=100&page=1?private_token=XXXXXX

perpage max is 100

curl --header "PRIVATE-TOKEN: W72WXtZCW6hGmyPT_meU" "http://git.unipus.cn/api/v4/projects?per_page=100&page=1" > a1.txt

curl --header "PRIVATE-TOKEN: W72WXtZCW6hGmyPT_meU" "http://git.unipus.cn/api/v4/projects?per_page=100&page=2" > a2.txt

import requests
url = 'http://git.unipus.cn/api/v4/projects?private_token=W72WXtZCW6hGmyPT_meU'
res = requests.get(url)
if res.status_code != 200:
raise ServerError(res.get('message'))

data = res.json()
for i in data:
print i,i[u'ssh_url_to_repo']

print "all success"

import json
filename = 'a2.txt'
with open(filename) as f:
gpd_list = json.load(f)
# 遍历列表的每个元素,每个元素是一个GDP数据项

for gpd_dict in gpd_list:
print gpd_dict['id'],gpd_dict['description'],gpd_dict['ssh_url_to_repo']

install gitlab as docker
https://www.jianshu.com/p/24959481340e
https://www.cnblogs.com/zuxing/articles/9329152.html

gitlab docker
docker pull gitlab/gitlab-ce:latest
mkdir -p gitlab/config
mkdir -p gitlab/logs
mkdir -p gitlab/data

--hostname localhost \

sudo docker run --detach \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /opt/dockerRoot/dockerData/gitlab/config:/etc/gitlab \
--volume /opt/dockerRoot/dockerData/gitlab/logs:/var/log/gitlab \
--volume /opt/dockerRoot/dockerData/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest

Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:

docker exec -it gitlab vim /etc/gitlab/gitlab.rb
docker restart gitlab

docker exec -it gitlab vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml

For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md

If this container fails to start due to permission problems try to fix it by executing:

docker exec -it gitlab update-permissions
docker restart gitlab

docker gitlab and gitlab api的更多相关文章

  1. Docker下安装GitLab

    1.需要先安装Docker和Docker Compose,参考:https://www.cnblogs.com/hackyo/p/9280042.html 2.配置GitLab SSL(可跳过): m ...

  2. 利用docker compose启动gitlab及runner

    添加docker compose配置文件 新建文件docker-compose.yml,输入如下内容: gitlab: image: 'gitlab/gitlab-ce:latest' contain ...

  3. 使用Docker Image跑Gitlab

    下载gitlab docker镜像 docker pull gitlab/gitlab-ce:latest 启动gitlab服务 sudo docker run --detach \ --hostna ...

  4. 在docker 中搭建gitlab环境

    docker run --name gitlab -it -p : -p : -p : \ --env 'GITLAB_SECRETS_DB_KEY_BASE=Rpwq35wjLJ5N6CrkvdXs ...

  5. docker下部署gitlab

    docker用来隔离应用还是很方便的,一来本身的操作较为简单,二来资源占用也比虚拟机要小得多,三来也较为安全,因为像数据库这样的应用不会再全局暴露端口,同时应用间的通信通过加密和端口转发,更加安全. ...

  6. docker中搭建gitlab

    1, 下载镜像 docker pull sameersbn/gitlab:7.4.3 # 下载gitlab镜像 docker pull sameersbn/mysql:latest # 下载gitla ...

  7. Ubuntu Docker 简单安装 GitLab

    相关博文: Ubuntu 简单安装 Docker Ubuntu 简单安装和配置 GitLab 服务器版本 Ubuntu 16.04 LTS. 1. 安装和配置 安装命令: sudo docker ru ...

  8. docker 下安装gitlab

    1.找到docker镜像 docker search gitlab 2.下载gitlab镜像 docker pull  gitlab/gitlab-ce/ 3.通常会将 GitLab 的配置 (etc ...

  9. Docker快速部署gitlab

    环境: Centos7.5 安装Docker 1.移除旧版本: $ sudo yum remove docker \ docker-client \ docker-client-latest \ do ...

随机推荐

  1. python 提取目录中特定类型的文件

    python使用‘os’和‘re’模块提取目录中特定类型的文件,这两个模都是安装python自带的,所以不需要安装. 思路: 使用os库lilstdir获取文件夹中的所有文件名,然后带上文件夹路径组合 ...

  2. python 版本号比较 重载运算符

    # -*- coding: utf-8 -*- class VersionNum(object): """ 版本号比较 默认版本以“.”分割,各位版本位数不超过3 例一: ...

  3. redis3集群管理

    以下操作基于redis3.X版本:Redis集群存储原理:Redis 集群使用数据分片(sharding),而非一致性哈希(consistency hashing)来实现,一个 Redis 集群包含 ...

  4. 【hive】centos7下apache-hive-3.1.2-bin的安装测试

    前言:安装hive还是遇见些问题,但还好都解决了,比当初安装配置hadoop-3.2.0容易点...... 正文: 1.下载并安装hive:tar -zxvf apache-hive-3.1.2-bi ...

  5. docker部署beego环境解决golang三方依赖库问题

    直接上图,有图有真相 Dockerfile文件中 运行dockercompose命令即可 以上请注意路项目路徑不要搞错

  6. 191010 python3分数划分ABC等级

    # 题目:利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,# 60-89分之间的用B表示,60分以下的用C表示. while True: score = input(" ...

  7. zabbix-web界面显示中文

    转载:https://www.cnblogs.com/miclesvic/p/6145171.html 1.确认zabbix是否开启了中文支持功能(/var/www/html/zabbix/inclu ...

  8. python3 操作 hive 安装依赖包整理

    安装依赖pip install saslpip install thriftpip install thrift-saslpip install PyHive windows安装sasl报错,解决方案 ...

  9. LA 3704细胞自动机——循环矩阵&&矩阵快速幂

    题目 一个细胞自动机包含 $n$ 个格子,每个格子的取值为 $0 \sim m-1$.给定距离 $d$,则每次操作是将每个格子的值变为到它的距离不超过 $d$ 的所有格子的在操作之前的值的和除以 $m ...

  10. 移动端videojs视频插件使用直播流rtmp、hls、http-flv的注意事项

    可以访问:https://videojs.com/ 下载对应的脚本包 特别注意的是 移动端videojs一般应用的直播流协议为HLS, RTMP协议一般是PC上使用,需要flash支持. HLS直播源 ...