gitlab

How do you push to a gitlab repo using a gitlab-ci job?

江枫思渺然 提交于 2020-01-10 14:30:38
问题 I am new to GitLab CI/CD jobs, but I'm trying to set up a Python script that when pushed to GitLab, triggers the CI/CD job to run it, and call an internal function that pushes to GitLab again provided that certain criteria are met. So, for example, suppose I have the following: def hasFileInDirectory(): # checks if the current directory has at least 1 other file in it if (1 or more files exist): print 'Great! You have enough files!'; else: print 'Oh no! You need more files! Let me create one!

Continuous Deployment of a NodeJS using GitLab

走远了吗. 提交于 2020-01-10 08:58:28
问题 I have an API developed in NodeJS and have successfully set up continuous integration via a .gitlab-ci.yml file. The next stage is to set up continuous deployment to Heroku if all tests pass on the master branch. There are plenty of tutorials covering the deployment of Ruby and Python apps but nothing on NodeJS. Currently my .gitlab-ci.yml file looks like this: image: node:latest job1: script: "ls -l" test: script: "npm install;npm test" production: type: deploy script: - npm install - npm

Continuous Deployment of a NodeJS using GitLab

好久不见. 提交于 2020-01-10 08:58:24
问题 I have an API developed in NodeJS and have successfully set up continuous integration via a .gitlab-ci.yml file. The next stage is to set up continuous deployment to Heroku if all tests pass on the master branch. There are plenty of tutorials covering the deployment of Ruby and Python apps but nothing on NodeJS. Currently my .gitlab-ci.yml file looks like this: image: node:latest job1: script: "ls -l" test: script: "npm install;npm test" production: type: deploy script: - npm install - npm

Gitlab: LDAP “Invalid credentials”, but credentials are right

痞子三分冷 提交于 2020-01-10 05:31:10
问题 The following ldapsearch command works, flawlessly. ldapsearch -LLL -s sub -P 3 -D "CN=,OU=IT,OU=Non-Users,OU=Users,OU=UserAccount,DC=,DC=com" -H ldaps://.com: -w '' -v -b 'OU=Users,OU=UserAccount,DC=,DC=com' '(&(objectClass=person)(sAMAccountName=))' But, regardless, of how much I double-check the values are typed correctly, this, configured in gitlab.yml, does not. ldap: enabled: true host: '.com' port: uid: 'sAMAccountName' method: 'ssl' bind_dn: 'CN=,OU=IT,OU=Non-Users,OU=Users,OU

【GitLab】问题汇总及解决方案

﹥>﹥吖頭↗ 提交于 2020-01-08 16:46:13
前言 记录自己在GitLab的搭建和使用中遇到的问题,并给出解决方案,持续汇总中…… 一、GitLab软件安装问题 1. 安装过程中卡住,无法进行下去   在卸载gitlab然后再次安装执行sudo gitlab-ctl reconfigure的时候往往会出现:ruby_block[supervise_redis_sleep] action run,会一直卡无法往下进行!   按住CTRL+C强制结束   运行: sudo systemctl restart gitlab-runsvdir      再次执行: sudo gitlab-ctl reconfigure 二、rpm安装包下载问题 三、gitlab配置问题 1. 浏览器访问gitlab服务器报502 原因及解决方案:   一、端口号被占用:Gitlab的默认启动端口是80,8080,很有可能与其他的端口产生冲突     1. 编辑配置文件        #vim /etc/gitlab/gitlab.rb     2. 更改参数        external_url 'http://localhost:8888'   //指定访问端口,默认是80        unicorn['listen'] = '127.0.0.1'        unicorn['port'] = 8001       // 为unicorn

GitLab Auto DevOps功能与Kubernetes集成教程

爷,独闯天下 提交于 2020-01-07 17:41:27
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 介 绍 在这篇文章中,我们将介绍如何将GitLab的Auto DevOps功能与Rancher管理的Kubernetes集群连接起来,利用Rancher v2.2.0中引入的授权集群端点的功能。通过本文,你将能全面了解GitLab如何与Kubernetes集成,以及Rancher如何使用授权集群端点简化这一集成工作的流程。本文非常适合Kubernetes管理员、DevOps工程师,或任何想将其开发工作流与Kubernetes进行集成的人。 背 景 什么是GitLab Auto DevOps? Auto DevOps是在GitLab 10.0中引入的功能,它让用户可以设置自动检测、构建、测试和部署项目的DevOps管道。将GitLab Auto DevOps与Kubernetes集群配合使用,这意味着用户可以无需配置CI / CD资源和其他工具,即可以部署应用程序。 什么是Rancher的授权集群端点? 从v2.2.0开始,Rancher引入了一项名为Authorized Cluster Endpoint的新功能,用户可以直接访问Kubernetes而无需通过Rancher进行代理。在v2.2.0之前,如果要直接与下游Kubernetes集群通信

Choerodon猪齿鱼实践之应用生命周期管理

混江龙づ霸主 提交于 2020-01-07 16:12:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Choerodon平台中的开发和部署都是围绕应用来进行的,那Choerodon平台中的应用有什么样的特性?又是怎样来进行管理的呢?本文旨在深入地介绍Choerodon平台中应用的功能特性及其生命周期的管理。 微服务架构中应用的特征 在谈起Choerodon平台中的应用时,就不得不提微服务。正是因为微服务的出现,之前的单体应用架构带来的问题才得以解决,具体问题如下: (1)耦合程度随时间推移而逐渐提高。 (2)扩展性差,冗余能力差 (3)模块划分不清晰,无法细化对系统资源的需求 (4)维护成本随着系统的日益臃肿而不断增加 而下图也更为直观地指出了单体应用架构与微服务架构的区别。 由此可见,微服务架构中的应用会被分解为更小、完全独立的组件,这使得它们拥有更高的敏捷性、可伸缩性和可用性。换句话说,微服务架构的基本思想就是“围绕业务领域组件来创建应用,让应用可以独立地开发、管理和加速。 Choerodon平台中应用生命周期的管理 由于Choerodon平台采用的是微服务架构,因此系统内每个功能模块均被解耦为多个应用,其中每个应用都支持独立地开发和独立地部署。而Choerodon平台中一个应用的生命周期一般从创建或导入应用开始;接着在开发流水线中按照需求对应用进行开发,待提交代码跑完CI之后,会生成一个应用版本

GitLab 使用git push 出现RPC failed; HTTP 500 curl 22 The requested URL returned error: 500

北城以北 提交于 2020-01-07 07:43:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 今天前端人员提交代码时,出现了如下奇怪错误: $ git push origin Counting objects: 4, done. Delta compression using up to 24 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 5.59 MiB | 16.73 MiB/s, done. Total 4 (delta 1), reused 0 (delta 0) error: RPC failed; HTTP 500 curl 22 The requested URL returned error: 500 Internal Server Error fatal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly Everything up-to-date 一看,6MB不到的文件居然提交失败,之前20M的文件都提交过. 网上搜了下,大多是说使用 git config --global http.postBuffer 524288000 将本地http的缓存加大到500MB,但试了下

gitlab私服(docker版本)

自闭症网瘾萝莉.ら 提交于 2020-01-07 07:39:06
1,docker pull beginor/gitlab-ce:11.0.1-ce.0 2,创建挂载目录   mkdir -p /mnt/gitlab/etc   mkdir -p /mnt/gitlab/log   mkdir -p /mnt/gitlab/data 3,启动 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 4,停止,删除容器   docker stop 容器id   docker rm 容器id 5, vi /mnt/gitlab/etc/gitlab.rb   external_url 'http://192.168.116.130' //改成宿主机的ip 6, vi /mnt/gitlab/data/gitlab-rails/etc/gitlab.yml   ##web server settings     host:

Github 下载代码时如何强制覆盖本地文件

北慕城南 提交于 2020-01-07 07:34:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在使用Git(Github,GitStash等)都是通过分支概念来协同操作。最近遇到一个问题,帮同事review code的时候 ,当我切换到别人的已提交分支的时候,同时我本地代码有更改,这时候执行 git pull 发现在项目的上面有向下的箭头并且显示多少数字,显示远程代码没下下载下来,有一个简单粗暴的解决方法就是删除本地代码,从git 上重新down一份 git clone ..... 这显示不是一个好的方案,不到万不得已,千万不要使用,虽然百分百有效,但是同时影响时间。 下面说第二种 通过reset 方式来下载并且覆盖本地代码。 在此以master分支来举例,需要执行的时候要换成自己分支的名字 git fetch origin master(master也可以替换成你自己想更新的分支名) git reset --hard master git pul fetch origin branch 是从远程获取最新代码 如何执行 fetch --all 是获取所有分支,一般没有必要。 以上可以强制下载最新git代码,但如果想要保存本地local文件,同时下载最新代码叫,这也是可以实现的。 git checkout master git branch new-branch-to-save-current