gitlab

How do I define a global gitignore, or implement it as a global pre-receive hook, in gitlab?

时光毁灭记忆、已成空白 提交于 2019-12-24 19:15:05
问题 In the ruby hook, I need to check the staged file format and restrict the commit, If the commit have .exe or .dll file. I got the idea to get the file list in ruby git diff --cached --name-only --diff-filter=ACM , But I failed to use the line in ruby script because I am newbie for ruby script. #!/usr/bin/env ruby Dir[git diff --cached --name-only --diff-filter=ACM].any? do |f| %w|.txt .pdf .dll|.include?(File.extname(f)) puts "Your commit have exe or dll file. Kindly remove the file an$ exit

Gitlab提交代码触发jenkins执行job

南笙酒味 提交于 2019-12-24 18:06:37
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、jenkins安装插件 gitlab-hook 下载地址: gitlab-hook.hpi ruby-runtime.hpi 安装好之后,重启jenkins 2、jenkins配置触发器 Build Triggers 勾选Build when a change is pushed to GitLab. GitLab CI Service UR 点击Advanced,生成token 3、gitlab项目配置 gitlab项目点击settings,然后点击integrations,将之前生成的URL和token填进去保存 然后点击测试,在jenkins看是否触发构建。 来源: oschina 链接: https://my.oschina.net/mingshashan/blog/3146772

Spring Cloud微服务(二): 配置中心

空扰寡人 提交于 2019-12-24 16:40:06
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> pring Cloud Config为分布式系统中的外部化配置提供服务器和客户端支持。 Spring Cloud Config原理 创建Spring Cloud Config 服务端 依赖 <?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.2.RELEASE</version> <relativePath/> </parent> <groupId>proj.ms</groupId>

Gitlab+Jenkins学习之路(二)之gitlab部署

寵の児 提交于 2019-12-24 16:08:08
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 1、安装依赖及gitlab [root@linux-node1 ~]# yum install -y curl policycoreutils openssh-server openssh-clients postfix [root@linux-node1 ~]# systemctl start postfix 2、安装gitlab 由于国内网络偏慢,这里使用清华大学的镜像源进行安装gitlab-ce [root@linux-node1 ~]# cat /etc/yum.repos.d/gitlab-ce.repo [gitlab-ce] name=gitlab-ce baseurl=http://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7 repo_gpgcheck=0 gpgcheck=0 enabled=1 gpgkey= [root@linux-node1 ~]# yum makecache [root@linux-node1 ~]# yum install -y gitlab-ce 3、修改配置文件 [root@linux-node1 ~]# vim /etc/gitlab/gitlab.rb external_url 'http://192.168

Gitlab+Jenkins学习之路(一)之Git基础

佐手、 提交于 2019-12-24 14:44:11
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Gitlab+Jenkins学习之路(一)之Git基础 1、GIT基础 GIT是一个分布式版本管理系统,速度快,适合大规模,跨地区多人协同开。SVN是一个集中式版本管理系统。 (1)GIT生态 GIT分布式版本管理系统 Gitlab git私库解决方案 Github git公有库解决方案 (2)Git安装 Centos: yum install -y git Ubuntu: apt-get install git Windows安装git bash Linux编译安装 注意不要使用git 1.8以下版本,推荐使用2.7版本 ①编译安装git [root@linux-node1 ~]# yum install -y epel-release 安装依赖包: [root@linux-node1 ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker [root@linux-node1 ~]# wget https://github.com/git/git/archive/v2.7.4.zip [root@linux-node1 ~]# yum install

基于Docker部署GitLab环境搭建

早过忘川 提交于 2019-12-24 11:53:23
基于Docker部署GitLab环境搭建 建议虚拟机内存2G以上 1.下载镜像文件 docker pull beginor / gitlab - ce:11 . 0 . 1 - ce . 0 注意:一定要配置阿里云的加速镜像 2.创建GitLab 的配置 (etc) 、 日志 (log) 、数据 (data) 放到容器之外, 便于日后升级, 因此请先准备这三个目录。 mkdir - p / mnt / gitlab / etc mkdir - p / mnt / gitlab / log mkdir - p / mnt / gitlab / data 3.运行GitLab容器 docker run \ -- detach \ -- publish 8443:443 \ -- publish 8090:80 \ -- name gitlab \ -- restart unless - stopped \ - v / mnt / gitlab / etc: / etc / gitlab \ - v / mnt / gitlab / log: / var / log / gitlab \ - v / mnt / gitlab / data : / var / opt / gitlab \ beginor / gitlab - ce:11 . 0 . 1 - ce . 0

How to fix SSH Webpack build timeout on CI/CD (Gitlab)

ぐ巨炮叔叔 提交于 2019-12-24 11:27:21
问题 I've created a CI/CD integration with Gitlab and keep stalling out on the final compilation of webpack and assets when running through the CI/CD. This is for a Linux 16.04 t2.small AWS instance and I'm curious if it is a memory / processor issue, though it seems to compile fine if I SSH into the server and run the cmd directly. deploy.sh #!/bin/bash set -e echo "Deploying to $DEPLOY_SERVER" # Once inside the server, run updateAndRestart.sh ssh -tt -o "StrictHostKeyChecking no" ubuntu@$DEPLOY

gitlab-ctl reconfigure: Unable to determine node name

邮差的信 提交于 2019-12-24 10:45:23
问题 I did setup a new GitLab instance on Ubuntu 16.04.4 LTS. Installing the package went fine and GitLab seems to be up and running. I then started to configure the instance and setup SMTP in /etc/gitlab/gitlab.rb . Afterwards I ran sudo gitlab-ctl reconfigure . It failed with the following error message: Starting Chef Client, version 13.6.4 Running handlers: There was an error running gitlab-ctl reconfigure: Unable to determine node name: configure node_name or configure the system's hostname

Importing commit from Bitbucket to Existing Gitlab repo

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 10:33:25
问题 I am working on this large project and my source code is being stored on Gitlab. I gave the code to another person and they have done some major work to it and they store it on Bitbucket. Now I want to take the person's code and add it to my existing Gitlab repo (as a new commit). How can I do that? I am using Windows. Thanks Edit: You have unmeged paths. 回答1: The easiest way to this is by using the Git bash that msysgit provides. You can setup multiple origins and you can merge their

How to migrate from Git-Annex to Git LFS

戏子无情 提交于 2019-12-24 10:23:30
问题 How can I migrate a repository in which I'm managing large files with Git-annex to manage them with Git LFS? Which commands should I run to disable annex and enable LFS? 回答1: After struggling a little bit, I've found the answer for this equation! We need to change annex mode to direct first, then git annex uninit , then change the mode back to indirect , then add, commit and push. $ git annex direct $ git annex uninit $ git annex indirect # add, commit and push # track with LFS (per file,