Articles of gitlab

如何在AWS上以Bitnami GitLab映像的pipe理员身份replace“[email protected]”?

安装GitLab AMI映像后,是否有一个快速入侵后端数据库来replace“@ example.com”引用到我自己的? 没有办法通过正常的用户界面来解决这个问题,因为它需要电子邮件确认。 说明很less。

systemd GitLab的单元文件

我目前正在编写一个Puppet模块来让GitLab在CentOS 6/7上运行。 对于CentOS 7安装,我需要编写一个systemd单元文件来启动gitlab服务(实际上是Unicorn&Sidekiq)。 下面是我根据对GitLab自己提供的初始化脚本的模糊理解提出的单元文件: [Unit] Description=GitLab After=network.target Requires=network.target After=mariadb.service Requires=mariadb.service After=redis.service Requires=redis.service [Service] EnvironmentFile=/etc/sysconfig/gitlab ExecStartPre=source /etc/profile.d/rvm.sh ExecStart=/bin/bash –pidfile=$UPID –user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV bin/web start" && /bin/bash –pidfile=$SPID –user=$USER "$PATH_PATCH RAILS_ENV=$RAILS_ENV bin/background_jobs start" [Install] WantedBy=multi-user.target 这里是关联的sysconfig文件: RAILS_ENV="production" USER=git APP_PATH=/home/$USER/gitlab UPID=$APP_PATH/tmp/pids/unicorn.pid ULOCK=/var/lock/subsys/unicorn SPID=$APP_PATH/tmp/pids/sidekiq.pid SLOCK=/var/lock/subsys/sidekiq PATH_PATCH="PATH=$(su $USER -s /bin/bash -l -c "echo \"\$PATH\"") && export PATH && " […]

Gitlab自定义钩子问题

我正在实现一个自定义的gitlab钩子。 当有人推入主人,我想更新一个特定的文件。 然后提交此更改并将其推送到远程原点。 钩子如下所示: clone_repo(){ //cloning a specifc branch on my_app dir export GIT_WORK_TREE="path/my_app" } cd_app(){ cd my_app } update_file(){ // updating random.java } commit_file(){ git commit -m "commit from hook" random.java } while read oldrev newrev refname do if [ ${refname} = "refs/heads/master" ] then clone_repo cd_app && update_file commit_file && push_it exit 0 […]

无法使用Apache和Tomcat在端口80上运行GitLab

我使用Omnibus安装程序安装了GitLab。 目前它正在使用运行在端口81上的Nginx(与GitLab捆绑在一起)正常工作。我从端口80更改为端口81,因为我的Apache运行在端口80上。我还安装了Tomcat并运行在端口8080上,所以我更改了独angular兽端口到8081.所有这些工作正常。 以下是我更改的设置: /etc/gitlab/gitlab.rb # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#configuring-the-external-url-for-gitlab external_url 'http://mysite.example.net:81' #https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#tcp-ports-for-gitlab-services-are-already-taken unicorn['port'] = 8081 #https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#storing-git-data-in-an-alternative-directory git_data_dir "/mnt/tank/gitlab" /var/opt/gitlab/gitlab-rails/etc/gitlab.yml production: &base # # 1. GitLab app settings # ========================== ## GitLab settings gitlab: ## Web server settings (note: host is the FQDN, do not include http://) host: mysite.example.net port: 81 https: false 不幸的是,我需要GitLab在80端口上运行。我尝试了几个Apache虚拟主机configuration。 我得到的唯一成功是我可以键入URL http://mysite.example.com/gitlab并获得一个404错误,但我看到该URL更改为http://mysite.example.com/users/sign_in 。 redirect导致gitlab被删除,但如果我把它放回来获取URL http://mysite.example.com/gitlab/users/sign_in我可以看到GitLablogin页面,虽然它都被抬起,因为没有的图像是正确的。 […]

Gitlab Omnibus,不能查看大多数提交(500),而且非常慢

我在Ubuntu 14.04上运行GitLab 7.9.2 c46d4f5(Omnibus) 当有人导航到一个提交gitlab返回时,我们有一半以上的提交 500我们很抱歉,但是出了点问题 另外,在不返回500的提交中,它们需要5到20秒的时间来显示页面。 我正在观察所有的日志,因为这是正在发生的事情,没有什么突出的问题正在发生。 当我去一个返回500错误的提交,nginx日志返回: 192.168.1.x – – [27/May/2015:09:35:44 -0500] "GET /project/module/commit/6876452e1df1d2846dhd1b2eb7d907e6ae8hf7d5 HTTP/1.1" 500 349 "https://gitlab.company.com/project/module/commits/staging" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36" 还有一些事情正在发生,我不确定是否正常是在nginx日志中每隔3到5秒我就会得到: 192.168.1.y – – [27/May/2015:09:40:06 -0500] "POST //api/v1/builds/register.json HTTP/1.1" 404 27 "-" "-" 192.168.1.y是一个gitlab ci亚军,我认为3-5秒的联系是某种forms的存活,但我绝对不知道。 任何帮助表示赞赏,没有其他日志显示任何错误,或任何奇怪的。 我已经检查过独angular兽,sidekiq,nginx和postgresql。 作为一个侧面说明,我仍然可以访问UI通过terminal提供的所有统计信息,但是我有很多喜欢使用UI的用户。 另外需要注意的是,这是一个在Hyper-v 2012上运行的虚拟机,并且已经从这些指令安装了linux工具。 话虽如此,我真的不认为这是与gitlab以外的任何问题。

持续集成运行器可以访问生产服务器

我正在为产品设置CI。 我正在使用Gitlab CI内部的Gitlab服务器来pipe理项目的testing和部署。 部署项目并不像同步文件那么简单。 它需要build立,检查不一致性,如果更新没有成功则回滚。 我担心的是运行testing和pipe理新代码集成的gitlab runner实例可以访问生产实例。 我的第一个想法是让跑步者简单地向生产服务器发送一个HTTP POST请求,要求它自己更新,然后报告是成功还是失败。 这样,跑步者无法访问生产服务器上的文件系统,并且生产服务器可以决定是否响应该请求。 这种方法的问题是POST请求很可能会超时等待响应,因为构build不是即时的。 我的第二种方法是让gitlab ci runner使用受限制的用户无密码的sshlogin到生产服务器,其唯一目的是构build和运行项目,以便运行者可以简单地使用结构脚本来更新服务器并直接报告失败。 这将很容易实现,并与Gitlab CI系统配合使用。 更新 :我尝试了面料的方法,但是当跑步者似乎不想login的时候,我停了下来。那么你的想法是什么? 一些docker魔法?

请求archive.zip时,Gitlabredirect循环

我已经使用nginx作为Arch机器上的Web服务器设置了一个Gitlab实例。 我已经采取的步骤是在Arch Wiki上 。 除了每个项目页面上的下载archive.zipbutton之外,一切正在运行:当我单击该button时,我正在进入无限redirect循环。 我没有使用https或任何非标准的安装程序,没有一个日志似乎给了我有用的故障排除方法。 production.log重复: Started GET "/tdubois/Wafer-CPC/repository/archive.zip" for 131.170.94.23 at 2015-09-02 14:11:31 +1000 Processing by Projects::RepositoriesController#archive as ZIP Parameters: {"namespace_id"=>"tdubois", "project_id"=>"Wafer-CPC"} Redirected to http://domain.edu.au/tdubois/Wafer-CPC/repository/archive.zip Completed 302 Found in 5020ms (ActiveRecord: 2.0ms) sidekiq.log重复: 2015-09-02T04:11:31.059Z 31495 TID-1n7fko RepositoryArchiveWorker JID-60d166f32ebd28ba6c591547 INFO: start 2015-09-02T04:11:31.064Z 31495 TID-1n7fko RepositoryArchiveWorker JID-60d166f32ebd28ba6c591547 INFO: done: 0.005 sec nginx访问日志重复: 131.170.94.23 – – […]

Gitlabredirect到其他页面

我有一段时间的gitlab安装。 前几天我使用这个教程做了一个更新。 我在pipe理面板中使用了一些设置,现在每次尝试访问我的gitlab面板时,我都被redirect到其他页面(我们的组织主页,不同的域名,不同的东西)。 我什至没有看到一个login页面,只得到302 http响应。 有没有可能导致这种情况的configuration选项? 我怎样才能find并修复它? 我把它安装在基本的windows azure linux实例上,没有改变configuration。 另外,当gitlab正在开始时,我没有得到302(系统reeboot之后的fe) – 然后我得到了503的信息,请求花了太长时间 – 因此我假设它不是系统或web服务器 – 只是gitlab做redirect。

尝试重新启动与gitlab运行器的tomcat 8,创buildpid文件,logging为空,服务器未启动

我正在尝试部署后重新启动我的tomcat 8服务器。 build立: gitlab-runner使用自己的用户(称为gitlab-runner) tomcat使用自己的用户名为tomcat sudoers有一个条目,以便gitlab-runner可以运行脚本: gitlab-runner ALL=(tomcat) NOPASSWD: /home/tomcat/deploy.sh 部署脚本只是将文件复制到webapps目录中,closures并重新启动它: cd /home/tomcat/bin sh catalina.sh stop -force … sh catalina.sh start 当我手动运行脚本作为gitlab的运行者用户一切工作正常: sudo -u tomcat /home/tomcat/deploy.sh 但是,当从gitlab-ci-multi-runner开始工作(推送到gitlab存储库)时,会发生以下情况。 gitlab-runner基本上写了一个script.sh然后执行上面的命令。 通常当我启动tomcat我看到以下输出:closures: Using CATALINA_BASE: /home/tomcat/ Using CATALINA_HOME: /home/tomcat/ Using CATALINA_TMPDIR: /home/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /home/tomcat/bin/bootstrap.jar:/home/tomcat/bin/tomcat-juli.jar Using CATALINA_PID: /home/tomcat/bin/catalina.pid 对于启动: Using CATALINA_BASE: /home/tomcat/ Using CATALINA_HOME: /home/tomcat/ Using […]

Gitlab 8.0.3与Apache2 / Nginx

背景 Ubuntu 15.10 Apache / 2.4.10(Ubuntu) 模块相关性全部启用: mod_rewrite的 mod_proxy的 mod_proxy_http GitLab社区版8.0.3 GitLab docroot:/ opt / gitlab / embedded / service / gitlab-rails / public 我以这种方式安装GitLab: https ://about.gitlab.com/downloads/#ubuntu1404 问题 在我的服务器上,我有一个运行Apache2(exemple-site.com)的网站。 我有GitLab与捆绑的nginx(exemple-gitlab.com) 我有1个服务器,1个IP和多个FQDN。 像这样,我所有的域名都指向GitLab。 所以exemple-gitlab.com指向GitLab,但exemple-site.com也指向GitLab,也指向其他所有FQDN。 解决方法 我想我必须(而且我试过): 禁用捆绑的nginx并configurationapache2的gitlab(很难做到这一点) 将绑定的nginxconfiguration为apache2的反向代理(很难做到) MAJ:事实上问题是Apache和捆绑的nginx运行在同一个IP上,并且有相同的端口(80)。 而且我不想在81端口上运行一个网站,只有80端口。 我更喜欢为我的所有PHP网站使用apache2,我不介意gitlab是否使用apache2或捆绑的nginx,我只需要使用我的每个网站的所有FQDN,而不是所有的FQDN redirectinf到gitlab。 理解 我不明白如何omnibus或铁路或反向代理工作。 我试过在/etc/gitlab/gitlab.rb禁用捆绑的nginx nginx['enable'] = false # For GitLab CI, use the following: ci_nginx['enable'] […]