打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Jenkins+Ansible+GitLab持续交付平台搭建-第2篇

这篇文章将继续给大家介绍Jenkins+Ansible+GitLab持续交付平台搭建。

Jenkins+Ansible+GitLab持续交付平台搭建-第1篇



GitLab使用

1.创建一个新项目

https://gitlab.example.com/root/xj_aml.git

2.创建克隆仓库到本地

# git -c http.sslverify=false clone https://gitlab.example.com/root/xj_aml.git

3.在仓库项目创建\提交代码

# git add .
# git commit -m "First commit"

###添加本地全局邮箱和用户名########
#git config --global user.email "admin@example.com"
#git config --global user.uame "admin"

###添加本地全局邮箱和用户名########
# git -c http.sslverify=false clone https://gitlab.example.com/root/xj_aml.git
# git add .
# git commit -m "First commit"
# git -c http.sslverify=false push origin master

###删除gitlab某个文件
# git pull origin master 将远程仓库里面的项目拉下来
# dir 查看有哪些文件夹
# git rm -r --cached portal/ 删除portal文件夹
# git commit -m '删除' 提交,添加操作说明
# git push -u origin master 将本次更改更新到github项目上去

遇到错误:error: failed to push some refs to 'https://gitlab.example.com/root/xj_aml.git'

原因分析:引起该错误的原因是目录中没有文件,空目录是不能提交上去的

解决办法:https://blog.csdn.net/s164828378/article/details/52425208

错误:fatal: not a git repository (or any of the parent directories): .git

解决方法 git init

错误$ git -c http.sslverify=false  push origin master

fatal: 'origin' does not appear to be a git repository

fatal: Could not read from remote repository.

解决:

git remote add origin git@github.com:djqiang(github账号名)/gitdemo(项目名).git

git remote add origin git@github.com:admin/test-repo.git

https://www.jianshu.com/p/feb3a14c24ef

解决git clone 解决Permission Denied (publickey)问题

https://blog.csdn.net/sxg0205/article/details/81412921

https://blog.csdn.net/sxg0205/article/details/81412921

错误:fatal: bad numeric config value 'fales' for 'http.sslverify': invalid unit

解决:删除本地克隆的文件及文件夹,从新克隆,或者关闭Git安全认证git config --global http.sslVerify false

502超时错误:https://gitlab.com/gitlab-org/gitlab-ce/issues/30095

http://fztree.iteye.com/blog/2240927

https://blog.csdn.net/bisal/article/details/60355056

warning: You appear to have cloned an empty repository.

或者

fatal: destination path '.' already exists and is not an empty directory.

解决方法:

ls -a

rm .git/ -rf

再运行一遍git clone

git fatal: destination path '**' already exists and is not an empty directory.解决

fatal: Unable to create 'C:/Users/admin/Desktop/report2/.git/index.lock': File exists.

解决:rm -f ./.git/index.lock   orwindows  del .git\index.lock

failed to push some refs to git

解决:https://blog.csdn.net/xsf50717/article/details/48947437

#查看gitlab本地配置
# git config --list

##查看Git用户名和邮箱
# git config user.name
# git config user.email

##修改自己的用户名和邮箱地址:
# git config --global user.name "xxx"
# git config --global user.email "xxx"

git remote add origin ssh@//gitlab.example.com/root/test-repo.git

GitLab应用场景

GitLab强大之处,强大的分布式

后台管理:可以针对不同项目,不同用户,订制不同的访问策略

开发人员视角:代码快速发布和审核,每一个项目下个个小组都会维护自己的代码分支,当这个分支多次在不同环境下部署测试成功之后,我们会提交一下master主分支合并的申请,等待项目领导去审核,决定是否去审核合并

权限:

不同的项目不同人员不同的权限


此系列会在我们TestOps公众号定期更新,请随时关注哟~

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
使用git clone 命令显示错误fatal: unable to access '××': OpenSSL SSL
fatal: unable to access ‘‘: TCP connection reset by peer
Bitnami Gitlab 安装配置 step by step
一目了然:git命令三种方式实现Gitlab和Github同时登录
Git认证方式https和ssh的原理及比较
初创公司应该如何做好持续集成和部署?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服