gitlab

自动化工具后起之秀Ansible的部署实践

ε祈祈猫儿з 提交于 2021-02-09 02:00:26
转载本文需注明出处:微信公众号EAWorld,违者必究。 从早期手动加脚本的部署方式,到后来自动化工具(chef, puppet, saltstack, ansible等)的出现,再到如今DevOps的盛行,企业应用部署正式进入平台部署阶段,CD(持续部署)已经成为企业对应用部署的标准需求,运维的交付也不再是以周或天为单位,而是以分钟为单位。 本文主要介绍自动化工具Ansible,及其在普元DevOps平台中的应用部署和日常应用部署中的实践。 本文目录: 一、如何选择合适的自动化工具? 二、Ansible架构图及工作流程 三、DevOps基于Jenkins+Ansible+GitLab的部署实践 四、Ansible日常应用部署实践 五、总结 一、如何选择合适的自动化工具? 面对众多的自动化工具(chef, puppet, saltstack, ansible等),我们该如何选择适合自己的呢?总的来说,无外乎从以下几点来权衡利弊。 活跃度(GitHub活跃度,社区活跃度) 学习成本 使用成本 编码语言 性能 各种开源的自动化工具在GitHub的关注度是其活跃度最直观的体现,从图中Contributors这一项就可以看出Ansible和SaltStack的开源项目贡献者远远多于其它几种自动化工具。越活跃的开源项目往往意味着更完善的功能和更高效的问题解决率。 Ansible

What is a GitLab line_code as referenced when creating a new merge request thread

别等时光非礼了梦想. 提交于 2021-02-08 15:01:59
问题 I'm trying to create a discussion note on a merge request on a certain line of a file with the GitLab api using this endpoint: https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-thread Part of the payload asks for a line_code Attribute Type Required Description position[line_range][start][line_code] string yes Line code for the start line When I issue a POST I get a response with: "message": "400 (Bad request) \"Note {:line_code=>[\"can't be blank\", \"must be a valid

Android: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

ⅰ亾dé卋堺 提交于 2021-02-08 13:15:22
问题 I am trying to build my project on GitLab CI but unfortunately for me I keep getting this error inside the runner: Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Now I know there is something wrong with my environment but I just cant get my mind wrapped around the problem. I searched on the web and I found I needed to update my .gitignore file and I did here it is: ### Java ### *.class ### Android ### *.apk *.ap_ ### Package files ### *.war *.ear *.aar ###

download directory from a branch using Gitlab API v4

孤街醉人 提交于 2021-02-08 10:42:48
问题 I am trying to download a directory inside of a 'release' branch of a repository from Gitlab. I am using API v4. The branch includes is of the below structure: - archive - outputs - history-2020-01-01T142535 - history-2020-01-15T142559 - history-2020-02-01T142540 I want to get the "history-2020-02-01T142540" directory. I can get a ZIP archive of the entire branch... https://<GITLAB_URL>/api/v4/projects/<PROJECT_ID>/repository/archive.zip?sha=<BRANCH_ID> How do I get a ZIP archive of only a

download directory from a branch using Gitlab API v4

蓝咒 提交于 2021-02-08 10:41:51
问题 I am trying to download a directory inside of a 'release' branch of a repository from Gitlab. I am using API v4. The branch includes is of the below structure: - archive - outputs - history-2020-01-01T142535 - history-2020-01-15T142559 - history-2020-02-01T142540 I want to get the "history-2020-02-01T142540" directory. I can get a ZIP archive of the entire branch... https://<GITLAB_URL>/api/v4/projects/<PROJECT_ID>/repository/archive.zip?sha=<BRANCH_ID> How do I get a ZIP archive of only a

GitLab clone error RPC failed; curl 56 The requested URL returned error: 401

谁说胖子不能爱 提交于 2021-02-08 08:12:20
问题 Using GitLab and Git Client version as - 2.22.0. recently we have uploaded audio/video related files into our repository, currently the repository size increased to 4.5 GB. Due to this now even we are unable to clone it. The following error being getting while cloning none of us able to clone. githost/tmp$ git clone https://pic-gitlab.com/pic_code/network-mm.git Cloning into 'network-mm'... Username for 'https://pic-gitlab.com': labuser Password for 'https://labuser@pic-gitlab.com': remote:

GitLab merge behavior - keep file from branch

僤鯓⒐⒋嵵緔 提交于 2021-02-08 07:58:29
问题 Is it possible to default to one branche's version of a file when doing merge requests in GitLab Web Interface? I'm trying to set up the GitLab Web Interface, so that you can use the graphical interface to do merge requests. In these merge requests, certain files on the target branch must not be subject to any changes. Most often, I'm working on web projects with a config.php, and here we can see how it's possible to not overwrite the config in branch 'prod' with anything (ie from 'dev')

How to import a private Go library (as module) within another private Go project (as module)

℡╲_俬逩灬. 提交于 2021-02-08 07:42:59
问题 I am moving a few private Go projects to GitLab while getting rid of Godeps , Go dep with vendor directory and all of that because I would like to use just Go modules. I am using Go version: go1.12.6 linux/amd64 . I have a private "library" project / git repository at gitlab.com/my-company/my-team/my-library . This works as a Go module with go.mod and go.sum . I would like to use my-library as a dependency for another project, this: gitlab.com/my-company/my-team/my-project . The structure of

Gitlab shared runner set concurrence for each project

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 05:30:45
问题 A shared runner is used by dozens of our project. I set concurrent = 5 in config.toml, so my runner can do 5 job concurrently for all project. For example, the following scenario:3 job for A project, 2 job for B project, 0 job for C project which causes C project should wait for at least 1 job of A or B project being finished until it starts first job. I want to set like "all project concurrent = 5 " and "each project concurrent = 2 ". Is there any way to deal with it? 回答1: There is an open

DevOps之代码模块设计浅析

[亡魂溺海] 提交于 2021-02-08 05:25:25
转载本文需注明出处:微信公众号EAWorld,违者必究。 // DevOps(开发:Development和运维:Operations的组合词)是一组过程、方法与系统的统称,用于促进开发(应用程序/软件工程)、技术运营和质量保障(QA)部门之间的沟通、协作与整合。 ——by 百度百科 // 今天的主题就是有关DevOps的很重要的一部分,Development中代码模块的设计。 代码模块说复杂也不复杂说简单也不简单,复杂是说它上承接着任务模块,下关联着构建模块,功能涉及到代码的对比合并、质量分析、关联的任务项等,缺了它就凑不成完整的DevOps流程。 简单是说该模块需要关注的点无非就是质量以及效率,一个项目在我看来代码才是根本,代码的产出质量效率越高,就越是节省项目的成本,有钱赚才是硬道理。 代码模块的受众也无非两类人: 开发人员 和 上层领导 。 开发人员眼中的代码模块是branch、tag、code、merge-request、quality等等诸多功能模块的混合体。 不行了,晕了 但是到了领导的眼里,报表即可解决问题: 一类报表说了张三今天代码产出了多少的缺陷多少的漏洞。 垃圾代码冠军得主,就是你 另一类报表说了李四本周就敲了10行代码效率极其低下。 是时候该炒李四鱿鱼了 所以创造一个 友好的代码管理功能交互页面 以及 简洁明了的代码质量效率报表界面