gitlab

定期备份和清理gitlab文件

痴心易碎 提交于 2019-12-06 16:24:41
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-12-05 14:39 # @Author : Anthony # @Email : ianghont7@163.com # @File : check_gitlab.py # import requests # import re # import time # # url = "http://gitlab.test.cn/api/v3/projects?private_token=xxxxx" # # response = requests.get(url) # print(response.json()) # import os import time import datetime import threading import subprocess # 注意点,千万要注意不要和内置方法重名啊!!!! # 文件所在路径 source_path = "/home/xxx/xxx/" # 当前时间 now_time = datetime.datetime.now() # 获取全部文件名称 source_path_lists = os.listdir(source_path) # 清理过期文件,只保留7天内 def remove_dated_files():

Can anyone post a working example of GitLab CI that has external submodules?

試著忘記壹切 提交于 2019-12-06 15:58:26
I am trying to get gitlab’s CI to work properly with an external submodule. I have a submodule in ANOTHER repository, so no relative path. I do NOT want to use a SSH key solution. I want to use the CI token (CI_JOB_TOKEN). Documentation is NOT clear because what is possible, or not, has changed and there are texts all over the place with many different approaches and, yet, nothing that fits the basic criteria. It used to not be possible to pull submodules, with CI, if they had an absolute path, so people came up with various solutions. Then it became possible and there are a few solutions

Git pull and push works in Windows but not in VM

喜夏-厌秋 提交于 2019-12-06 15:35:42
问题 I've recently set up a Git repository and after some fiddling managed to get everything set up correctly so that I could pull and push from Git in my Windows 8.1 environment using SSH keys and pulling from Gitlab ... however in my Ubuntu VM I try to do the same thing (all from command line by the way in both environments if that helps) and it starts asking me for a password which to me would suggest that the VM doesn't know the location of my SSH keys? I could be way off with that thought

gitlab + jenkins 自动部署

非 Y 不嫁゛ 提交于 2019-12-06 15:33:39
一。安装gitlab 和 jenkins 直接克隆项目 git clone git@gitee.com:GH16/devops.git 进入项目,直接运行, 等待五分钟左右部署(显示出错也会重启继续初始化) ➜ ~ cd devops ➜ devops git:(master) ls README.en.md docker-compose.yml jenkins stop.sh README.md gitlab start.sh ➜ devops git:(master) bash start.sh 浏览器输入 http://127.0.0.1:10080 先创建root用户的密码 登陆成功后 settings->preferences->language 可设置中文,接着配置ssh密钥 配置完ssh密钥后,创建项目 创建成功后克隆项目 ➜ ~ git clone ssh://git@localhost:10022/root/test_gitlab.git 进入项目,修改文件 ➜ ~ cd test_gitlab ➜ test_gitlab git:(master) ls README.md ➜ test_gitlab git:(master) cat README.md # test_gitlab ➜ test_gitlab git:(master) echo '1' >

06.Linux系统-GitLab版本控制服务安装部署

纵然是瞬间 提交于 2019-12-06 13:58:07
官方文档:https://about.gitlab.com/install/#centos-7 1.yum install -y curl policycoreutils-python openssh-server 2.systemctl start sshd 3.yum install postfix 4.systemctl start postfix 注:报错就改/etc/postfix/main.cf-->inet_interfaces = all 5.curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | bash 6.EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee 建议下载对应版本然后yum install -y xxxxx 在修改/etc/gitlab/gitlab.conf中的EXTERNAL_URL 首先修改gitlab.rb文件再进行加载配置文件,不然会冲突 gitlab命令:gitlab-ctl reconfigure 刷新加载配置文件 gitlab-ctl stop/statr/status 注: 首先呢 如果是个空机器什么都不用管 域名映射直接访问就行了

Gitlab Pages custom domain SSL

自闭症网瘾萝莉.ら 提交于 2019-12-06 13:41:50
I'm trying to add TLS/SSL to my custom domain on Gitlab. Currently it says my site is available at https://yodel.co , but when I go there it says the certificate is invalid. How do I go about validating the certificate? In the docs (also pictured) it says there are keys to add from your admin when setting up a new domain. However I'm not sure where to get these keys as I am the admin. My Gitlab Pages Gitlab docs screenshot You can simplify, 3 years later, your process by using GitLab 12.1 (July 2019). It comes with " Automatic HTTPS for Pages with Let's Encrypt ": In 12.1, Pages users that add

How to SetUp Protractor with GitLab and Jenkins

梦想的初衷 提交于 2019-12-06 13:37:15
Please let me know if anyone have tried integration of protractor with Jenkins. Regards, Manan Integration with jenkins is relatively simple. The biggest hurdle is ensuring that the boxes which have Jenkins installed are up to date and have the required resources. If you want to test in Firefox on jenkins - you will need XVFB installed. Luckily for you, there is a plugin for that: https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin Running protractor protractor.js.conf will return a 0 or a 1 depending on success or failure. Run that command in shell script. Jenkins will take care of

Gitlab: can't SSH from home (Windows)

泄露秘密 提交于 2019-12-06 12:52:18
I can't get SSH to work for GitLab from my home PC. To be clear: 1. SSH works fine for BitBucket on the same machine 2. SSH key has been added and is correct 3. I'm connected through a VPN (working) I get the following output when I try to connect with -v -v -v parameters: $ ssh git@[server] -v -v -v OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014 debug1: Reading configuration data /c/Users/[me]/.ssh/config debug2: ssh_connect: needpriv 0 debug1: Connecting to [server] [ip] port 22. debug1: connect to address [server] port 22: Attempt to connect timed ` out wssh: connect to host [server] port 22: Bad

部署gitlab并汉化

大憨熊 提交于 2019-12-06 12:45:42
一.gitlab简介 gitlab是一个用于仓库管理系统的开源项目。使用git作为代码管理工具,并在此基础上搭建起来的web服务。可通过web界面进行访问公开的或者私人的项目。它拥有与github类似的功能,能够浏览源代码,管理源代码缺陷和注释。可以管理团队对仓库的访问,它非常易于为浏览器提交过的版本提供一个文件历史库。团队成员可以利用内置的简单聊天程序(wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用。 二.gitlab安装 1.下载任意版本的gitlab的rpm包 官方地址: https://about.gitlab.com/ 推荐下面的地址下载:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm这里使用的是gitlab-ce-12.3.5版本,你可以根据自己的需求下载。 [root@git ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.3.5-ce.0.el7.x86_64.rpm 2.安装gitlab [root@git ~]# yum -y localinstall gitlab-ce-12.3.5-ce.0.el7

GitLab+Jenkins实现持续集成+自动化部署

北慕城南 提交于 2019-12-06 12:45:26
一.自动化上线代码基本介绍 1.软件开发生命周期 老板创意---产品经理---立项---开发团队---测试团队(黑白盒)---运维上线 产品经理---加需求---开发团队---测试团队---运维更新代码上线 2.什么是环境? 开发环境:开发自己用的电脑本地自己装的php python的开发工具等。 测试环境:多个人的代码合起来跑一遍,运行一次,测试mysql redis等。 预发布环境:直接连接线上数据库,专门的测试域名小范围内测试。 生产环境:线上环境 每个项目一套环境 (线下可以放一起配多域名 线上不行)。 3.什么是持续集成(CI)? 每天都进行一次代码合并,就是持续集成。 多个开发写的代码 集中起来管理 放到代码库里 (版本控制管理软件)代码库工具:svn git(多) 。(版本控制系统:类似于快照的增量备份的机制,也就是每一次版本更新,都会在原来的基础上保留变化的内容,生成一个新的版本,之前的版本也会被保留,以便快速回滚。) 每天都要做代码合并,防止冲突,在合并的时候会产生冲突,所以提交的时候有先后顺序,就是你先上传,然后我把你上传的拉过来和我的进行合并,排除冲突,然后我在上传到主分支。持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员至少集成一次,也就意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译、发布、自动化测试)来验证