ARTS-07月1日到07月07日

英文阅读

本文介绍了Gitlab CI CD,属于Gitlab的官方文档 https://about.gitlab.com/product/continuous-integration/

文中涉及到几个概念Gitlab CI,Gitlab CD,GitLab Runner,Pipelines

Gitlab CI

What is CI?
Continuous Integration is the practice of integrating code into a shared repository and building/testing each change automatically, as early as possible - usually several times a day.

CI翻译为持续集成,是基于团队共享代码库,开发人员合并提交代码后,触发事先编写好的pinpine构建任务,对代码进行构建,测试的过程。

CI是基于共享代码库的代码集成实践,基于每一次的更改进行构建和测试,通常一天进行很多次。

What is CD?

Continuous Delivery adds that the software can be released to production at any time, often by automatically pushing changes to a staging system.

CD用于对稳定系统的推送,在任何时候,自动的可以发布到生产环境。
Continuous Deployment goes further and pushes changes to production automatically.

Why your team needs a CI/CD workflow

Continuous Integration
Detects errors as quickly as possible: fix problems while fresh in developers mind

更快更可能的检测到错误

Reduces integration problems: smaller problems are easier to digest
降低集成问题,小的问题容易被消化

Avoid compounding problems: allows teams to develop faster, with more confidence
忽略混合问题,允许团队更快,更信任的开发

Continuous Delivery

Ensures every change is releasable: test everything, including deployment, before calling it done
确保每次更改都是可发布的
Lowers risk of each release: makes releases “boring”
对于每一次发布是低风险的
Delivers value more frequently: reliable deployments mean more releases
更多的部署代表更多的版本
Tight customer feedback loops: fast and frequent customer feedback on changes
在变化中快速频繁的接受客户的反馈

image.png

What are the advantages of GitLab CI/CD?

  • Integrated: GitLab CI/CD is part of GitLab, enabling a single conversation from planning to deployment (and beyond)
    GitLab CI/CD 是GitLab 的一部分
  • Open source: CI/CD is a part of both the open source GitLab Community Edition and the proprietary GitLab Enterprise Edition
    社区版本和企业版本均是开源的
  • Easy to learn: See our Quick Start guide
  • Seamless: Part of the single GitLab application, with a single great user experience
  • Scalable: Tests run distributed on separate machines of which you can add as many as you want
  • Faster results: Each build can be split in multiple jobs that run in parallel on multiple machines
  • Optimized for delivery: multiple stages, manual deploy gates, [environments,]
    (https://docs.gitlab.com/ee/ci/environments.html) and variables
image.png

GitLab is one application for the entire DevOps lifecycle

GitLab是整个DevOps生命周期的一部分

  • Build your application using GitLab Runners
    构建
  • Run unit and integration tests to check if your code is valid
    测试
  • Look at a live preview of your development branch with [Review Apps]
    (https://about.gitlab.com/product/review-apps/)before merging into stable
    在线预览
  • Deploy to multiple environments like staging and production, and support advanced features such as canary deployments
    基于不同环境的部署
  • Monitor performances and status of your application
    监控
    image.png
image.png

Architecture

GitLab CI/CD

GitLab CI/CD is a part of GitLab, a web application with an API that stores its state in a database. It manages projects/builds and provides a nice user interface, besides all the features of GitLab.

GitLab Runner

GitLab Runner is an application which processes builds. It can be deployed separately and works with GitLab CI/CD through an API.

In order to run tests, you need at least one GitLab instance and one GitLab Runner.

GitLab Runner

To perform the actual build, you need to install GitLab Runner which is written in Go.

It can run on any platform for which you can build Go binaries, including Linux, OSX, Windows, FreeBSD and Docker.

It can test any programming language including .Net, Java, Python, C, PHP and others.

GitLab Runner has many features, including autoscaling, great Docker support, and the ability to run multiple jobs concurrently.

Pipeline

一次 Pipeline 其实相当于一次构建任务,里面可以包含多个流程,如安装依赖、运行测试、编译、部署测试服务器、部署生产服务器等流程。

技巧呈现

php-ext-excel-export扩展使用札记

PHP环境下的导出功能优化改造,单次同步导出数据量在2万之上。 原有导出功能使用的PHP5.6+PHPExcel.这一次换成了PHP7.2+php-ext-excel-export。同步导出几万条性能还可以接受。

文章分享

分享文章 Mac安装Zookeeper带来的Zookeeper简单介绍及思考

本篇以PHP环境下Zookeeper扩展安装为起点,简单介绍了Zookeeper基本概念和使用场景,不是很完整。如果PHP和Zookeeper作为一个分布式系统的客户端而言,网上的使用案例非常有限,跟PHP环境下熔断组建的使用一样,案例非常少,稳定性不能保证。

从两方面来看这个事:一,业界基本没有这样的使用场景和技术案例,为什么没有,因为PHP语言生态不适合做这块,能做吗,或许能做,但是不适合,不是强项。二,如果有类似的需求,我们不应该选择PHP来做这块,因为整个业界都没有这样做的,我们应该把经历花在更有意义的选择上。

参考资料

用 GitLab CI 进行持续集成

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,524评论 5 460
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,869评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,813评论 0 320
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,210评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,085评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,117评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,533评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,219评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,487评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,582评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,362评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,218评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,589评论 3 299
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,899评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,176评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,503评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,707评论 2 335

推荐阅读更多精彩内容