架构图docker
整体流程shell
重要步骤
1.添加LDAP认证
全局--安全--认证--编辑--启用OpenLDAP认证
设置仅容许受权的用户和组织,方便帐号管理及安全使用centos
2.添加通知
Local--工具--通知
默认支持Slack、Mail、PagerDuty、Webhook、企业微信、钉钉、Microfoft Teams,这里选择邮件安全
3.添加日志
Local--工具--日志
有Elasticsearch、Splunk、Kafka、Syslog、Fluentd,这里使用的是Elasticsearchbash
4.集成Gitlab
Local--Defalt--工具--流水线
须要先在Gitlab对应项目帐号中新建Application,而后在流水线中配置Gitlab应用,设置好id和secret后验证确认受权微信
5.配置镜像库凭证
Local--Default--资源--密文--镜像库凭证列表--添加凭证架构
6.配置流水线
Local--Default--资源--流水线--设置代码库--启用项目--编辑流水线app
查看YAML以下maven
stages: - name: Build steps: - runScriptConfig: image: core-harbor.minminmsn.com/public/centos-jdk8-maven shellScript: bash ./build.sh - name: Publish steps: - publishImageConfig: dockerfilePath: ./Dockerfile buildContext: . tag: core-harbor.minminmsn.com/public/${CICD_GIT_REPO_NAME}:${CICD_GIT_COMMIT} pushRemote: true registry: core-harbor.minminmsn.com - name: Deploy steps: - applyYamlConfig: path: ./deployment.yaml notification: recipients: - recipient: op@minminmsn.com notifier: local:n-chlz9 condition: - Success
7.运行流水线ide
部署成功能够发邮件