gitlab

Multiple git post-receive hooks

大城市里の小女人 提交于 2019-12-10 10:49:57
问题 i'm using Gitlab. Gitlab is creating following link to distribute the same hooks through all repositories hooks -> /opt/gitlab/embedded/service/gitlab-shell/hooks Within this directory there's already a post-receive hook to process the commits properly within Gitlab which is written in ruby. I'd like to add an additional hook written in bash. Is this possible? Best regards 回答1: Gitlab supports project hooks in a $GIT_DIR/custom_hooks directory. This is supported for the pre-receive , post

Redmine error log fatal:not a git repository

…衆ロ難τιáo~ 提交于 2019-12-10 10:42:37
问题 I installed redmine on git server (gitlab), which is our main git server (same machine). When I add the repository (through gitlab) information in redmine web, The redmine log says: /usr/local/redmine/log/production.scm.stderr.log < fatal: Not a git repository: '/data/gitlab/git-data/repositories/woojs/RedmineTestProject.git/' But when I check the whether bare or non-bare using git command, I get this: root@gitserver:/data/gitlab/git-data/repositories/woojs/RedmineTestProject.git# git rev

Can't connect jenkins to gitlab

杀马特。学长 韩版系。学妹 提交于 2019-12-10 10:40:07
问题 I have a setup of 2 VMs : VM1 with jenkins, VM2 with gitlab On VM2 I have created a repo with user root with public access http://192.168.0.32/root/sparkjava_hello_world (acccess OK) and generate the access token On VM1: - I installed the gitlab plugin in jenkins - I copied the public key of user jenkins to authorized_key of user git in VM2 : from user jenkins shell, ssh git@VM2 is OK, no password asked - I created the gitlab api credential and pasted the access token in it - I configured the

Gitlab Merge request events not triggering Jenkins Multi-branch pipeline

白昼怎懂夜的黑 提交于 2019-12-10 09:44:55
问题 I'm trying to trigger Jenkins Multi-branch pipeline job with GitLab Webhook on Merge request events. When I'm testing the Webhook, I'm getting this message: Hook executed successfully but returned HTTP 409 When I'm setting different GitLab Webhook, like Tag push events, it works. Is GitLab Merge request events Webhook not supported with Jenkins multi-branch pipeline? Am i missing something? If it's not supported, does anyone have workaround for that? Thanks! 回答1: https://github.com/jenkinsci

How to get subfolders and files using gitlab api

冷暖自知 提交于 2019-12-10 09:24:18
问题 I am using gitlab api to get the files and folders and succeded, But I can able to get only directory names, not its subfolders and files. So, how can i get full tree of my repository. Please let me know. Thanks in advance, Mallikarjuna 回答1: According to the API, we can use GET /projects/:id/repository/tree to list files and directories in a project. But we can only get the files and directories in top-level of the repo in this way, and sub-directories of directories in top-level with param

Jenkins

纵饮孤独 提交于 2019-12-10 07:46:14
简介 Jenkins是一个开源软件项目,是基于Java开发的一种持续集成的工具,用于监控持续重复的工作,旨在提供一个开放易用的软件平台 功能介绍: 一个自动化的周期性集成测试过程,从检出代码、编译构建、运行测试、结果记录、测试统计等都是自动化完成的,无需人工干预,有利于减少重复过程以节省时间、费用和工作量 它需要有代码托管工具支持,比如SVN git,gitlab 监控软件开发流程,快速显示问题 什么是持续集成 持续集成(continuous integration),简称CI,是指开发阶段,对项目进行持续性自动化编译、测试,以达到控制代码质量的手段。持续集成是一种软件开发实践 为什么要持续集成: 易于定位错误。也就是当你的持续集成失败了,说明你新加的代码或者修改的代码引起了错误 更加充分地的测试系统中的各个单元 有助于项目的开发数据的收集 便于开发流程的管理。要把一个开发的build提交给测试组作测试,测试满意了,再提交到发布组去发布 jenkins常见插件及含义 LDAP 这个插件允许使用LDAP对用户进行认证,LDAP服务器可以为Active Directory 或OpenLDAP Active Directory 这个插件允许使用Active Directory对用户进行认证,同时结合诸如Matrix Authorization strategy插件

Is there a way to add users automatically into gitlab?

半腔热情 提交于 2019-12-10 06:55:10
问题 I've got a gitlab running on server. For now, I've also got just a list of users and emails needed to be add into gitlab. Is there a way to do this automatically? (i.e. by script/service) 回答1: You can use the GitLab API to create users in a script. Recent versions of curl can url-encode POST data for you. Otherwise spaces will have to be %20 and --data instead of --data-urlencode . curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" --data-urlencode "email=jon@doe.com&password=defaultpassword

Gitlab中集成Kubernetes

假装没事ソ 提交于 2019-12-10 05:35:55
Gitlab中集成Kubernetes 前言 Gitlab中集成Kubernetes 欺骗Gitlab安装Helm Tiller 前言 本文适用于在Gitlab中集成没有梯子的K8s集群 文中使用的各系统版本: CentOS 7.6 GItlab 12.3.1 K8s 1.16.3 Helm 2.16.1 Tiller 2.15.1 前段时间想要做一站式CICD所以没有使用Jenkins做CICD平台而是使用了GItlab-Runner, 体验了一段时间,发现Gitlab-Runner还是很好用的,除了要升级runner所在机器的git版本以外,暂时没有遇到同其他的问题,如果git版本过低的话,有时候会报下面这个错误: fatal: git fetch pack: expected shallow list 这时候只需要升级git版本即可解决: curl https://setup.ius.io | sh yum remove -y git yum -y install git2u git version 下面言归正传 Gitlab中集成Kubernetes 刚好之前部署过用于测试的k8s,但是没有用起来,刚好发现新版的gitlab可以集成K8s到gitlab中做AutoCICD,于是开始在gitlab中添加K8s集群,按照官方手册提示的步骤,添加一切顺利,但是到了安装Helm

Centos7上GitLab的安装和卸载

主宰稳场 提交于 2019-12-10 05:06:15
1 安装 安装所需的依赖 yum -y install policycoreutils openssh-server openssh-clients postfix 下载对应的安装包,在 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/ 进行查找 https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-12.1.12-ce.0.el7.x86_64.rpm 安装 rpm -i gitlab-ce-12.1.12-ce.0.el7.x86_64.rpm 修改端口 修改 /etc/gitlab/gitlab.rb 中的 external_url 参数 设置为访问的域名或者ip 修改 /etc/gitlab/gitlab.rb 中的 unicorn['port'] 参数为指定的端口 暴露相应的端口 firewall-cmd --zone=public --add-port=8080/tcp --permanent 加载配置文件并重启 gitlab-ctl reconfigure gitlab-ctl restart 1.1 配置阿里企业邮箱 在 /etc/gitlab/gitlab.rb 中增加如下配置 gitlab_rails['smtp_enable

How to clone a private git repository into a kubernetes pod using ssh keys in secrets?

北战南征 提交于 2019-12-10 04:33:11
问题 I am trying to clone a private git repository(gitLab) into a kubernetes pod, using SSH keys for authentication. I have stored my keys in a secret. Here is the yaml file for the job that does the desired task. Heres the same question, but doesnt give the exact solution : Clone a secure git repo in Kubernetes pod Logs of the init container after execution: fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64