当前位置: 首页 > news >正文

阿里巴巴网站上面产品描述一般怎么做的软文世界平台

阿里巴巴网站上面产品描述一般怎么做的,软文世界平台,找一些好的网站建设案例,成人设计培训班多少钱目录 1. 说明 2. 资源要求 3. 安装 4. 配置实践 4.1 服务器 4.2 人员与项目 4.2 部署准备 4.2.1 访问变量及用户账号设置 4.2.2 Runner设置 4.2.3 要点 5. 应用项目 CI/CD 6. 参考 1. 说明 gitlab是一个强大且免费的代码管理/部署工具,能统一集成代码仓…

目录

1. 说明

2. 资源要求

3. 安装 

4. 配置实践

4.1 服务器

4.2 人员与项目

4.2 部署准备

4.2.1 访问变量及用户账号设置

4.2.2 Runner设置

4.2.3 要点

5. 应用项目 CI/CD

6. 参考


1. 说明

    gitlab是一个强大且免费的代码管理/部署工具,能统一集成代码仓库,CI/CD的工作。开始时我以为只能在官网上使用,后来才知道能私有化部署,确实了不起。

原理图:

2. 服务器

    gitlab资源要求比较高,建议8核16G,目前我的虚拟机是分配了5核12G,要是工作负荷上来,还要划拨资源。

ServerIP配置备注
host001.dev.ia192.168.0.1305核/12G/200G硬盘Gitlab服务器 / Gitlab Runner工作站 / 开发服务器1
host002.dev.ia192.168.0.1312核/4G/200G硬盘开发服务器2

在各自的 /etc/hosts 做上述设定

3. 安装 

docker-composer方式,指定外部访问url为 http://host001.dev.ia:18181

gitlab.yml

version: "3.5"services:web:image: 'gitlab/gitlab-ce:latest'container_name: gitlabrestart: alwayshostname: 'gitlab.dev.ia'environment:GITLAB_OMNIBUS_CONFIG: |external_url 'http://host001.dev.ia:18181'# Add any other gitlab.rb configuration here, each on its own lineports:- '18181:18181'- '2222:22'volumes:- '/data0/Server/Settings/gitlab:/etc/gitlab'- '/data0/Server/Logs/gitlab:/var/log/gitlab'- '/data0/Server/Db/gitlab:/var/opt/gitlab'shm_size: '256m'

安装后进去容器设置管理员(root)密码

gitlab-rails console -e productionirb> user = User.where(id: 1).first
irb> user.password = 'xxx'
irb> user.password_confirmation = 'xxx'
irb> user.save!

4. 配置实践

4.1 人员与项目

进入管理后台,建立两个开发组,3名用户成员 (Regular Member权限,配置ssh公钥),两个团队项目, 每个项目分别建    dev / staging / live 分支,检查 pull & push是否正常

GroupMemberProjectBranch
Dev1ben, developer1Team1 Prj1dev / staging / live
Dev2ben, developer2Team2 Prj1dev / staging / live

如图:

4.2 部署准备
4.2.1 访问变量及用户账号设置

- 在gitlab服务器,因为docker化安装的,需映射ssh访问端口 22 => 2222

- 用工具生成deployer密钥,然后用管理员账号登录gitlab后台: 

-- 配置deployer私钥变量

    Admin Area => Settings => CI/CD => Variables, 定义 SSH_PRIVATE_KEY,用deployer的私钥填充,将在.gitlab-ci.ym里使用。(注:去掉默认的Protect variable勾选,不然部署时会出现“Error loading key "(stdin)": error in libcrypto”问题)

-- 配置仓库访问公钥, 可选择添加:公共的部署公钥或项目部署公钥(2选1)

A 公共公钥:Admin Area => Deploy Keys,然后在项目Deploy keys中enable之

B 项目公钥:切换到项目 Settings => Repository => Deploy keys,添加deployer的Privately keys并且enable,使得deployer用户可访问代码仓库

- 在部署服务器建deployer账号,分配密钥,目录访问权限,脚本:

adduser deployer
setfacl -R -m u:deployer:rwx /www/wwwroot# 为解决安全及读写权限问题,把deployer添加到www组,把www加到deployer组
usermod -aGwww deployer
usermod -aGdeployer www# 建立密钥文件, 通过vi把该用户的密钥加上
mkdir -p /home/deployer/.ssh && touch /home/deployer/.ssh/authorized_keys && touch /home/deployer/.ssh/id_rsa && touch /home/deployer/.ssh/configchmod 700 /home/deployer/.ssh && chmod 600 /home/deployer/.ssh/id_rsa && chown deployer:deployer -Rf /home/deployer/.ssh

- 为了ssh能正确访问git仓库(端口映射),需编辑 /home/deployer/.ssh/config

Host host001.dev.iaUser gitHostname host001.dev.iaPort 2222Preferredauthentications publickeyIdentityFile ~/.ssh/id_rsaTCPKeepAlive yesAddKeysToAgent yes

 完成后用deployer登录目标机器,测试是否能连接gitlab, 克隆仓库

ssh -T git@host001.dev.iagit clone git@host001.dev.ia:dev1/team1-prj2.git
4.2.2 Runner设置

Runner 所处位置图: 通过Runner工作组,根据脚本进行构建与分发

用root账号登陆,在管理面板(Admin Area)=> CI/CD => Runners页上建Runner,它实际上是个运行代理器,让工作机的关联进来,通过定义tag来调配对应的运行器完成任务,这里我定义了一个php的runner

gitlab在项目管理中提供了Pipeline editor工具,可以在不同分支定义一个.gitlab-ci.yml文件,记叙CI/CD步骤与详细内容,当用户提交并推送代码时触发过程

工作机安装gitlab-runner客户端, 脚本 gitlab-runner-install.sh

#!/bin/bash# Download the binary for your system
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64# Give it permission to execute
sudo chmod +x /usr/local/bin/gitlab-runner# Create a GitLab Runner user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash# Install and run as a service
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start

注册runner

gitlab-runner register  --url http://host001.dev.ia:18181  --token glrt-HfgiG84kn28NvU69stkh- 选择shell类型gitlab-runner run# 其他相关命令
gitlab-runner list
gitlab-runner unregister --all-runners
gitlab-runner unregister  --url http://host001.dev.ia:18181  --token glrt-ABh3NZLwxomjSk6szHbz
4.2.3 要点

- 在gitlab文档中,是没有提及给gitlab-runner账号配deployer私钥的,当用giltlab-runner账号在终端进行手动测试时,需把deployer的id_rsa拷贝过去 gitlab-runner/.ssh目录下。

5. 应用项目 CI/CD

请关注后续序列文章

6. 参考

- Use SSH keys to communicate with GitLab | GitLab

- .gitlab-ci.yml 配置 · PHP/Python/前端/Linux 等等 学习笔记 · 看云

- gitlab runner tag - 简书

- https://dev.to/techworld_with_nana/gitlab-cicd-for-beginners-free-course-2mee


文章转载自:
http://dinncobasset.wbqt.cn
http://dinncosynapte.wbqt.cn
http://dinncoclaudian.wbqt.cn
http://dinncoattached.wbqt.cn
http://dinncoflyboat.wbqt.cn
http://dinncohalothane.wbqt.cn
http://dinncogracile.wbqt.cn
http://dinncoboite.wbqt.cn
http://dinncohandily.wbqt.cn
http://dinncoperchlorinate.wbqt.cn
http://dinncocounterpane.wbqt.cn
http://dinncoconfide.wbqt.cn
http://dinncoshipway.wbqt.cn
http://dinncosuperexcellent.wbqt.cn
http://dinncodiskette.wbqt.cn
http://dinncofelipa.wbqt.cn
http://dinncoradwaste.wbqt.cn
http://dinncoantimorph.wbqt.cn
http://dinncosublattice.wbqt.cn
http://dinncodisgustingly.wbqt.cn
http://dinnconemophila.wbqt.cn
http://dinncocynosure.wbqt.cn
http://dinncoeutectic.wbqt.cn
http://dinncomisdeal.wbqt.cn
http://dinncocadaster.wbqt.cn
http://dinncovacua.wbqt.cn
http://dinncodenial.wbqt.cn
http://dinncolimacine.wbqt.cn
http://dinncocambism.wbqt.cn
http://dinncofortifiable.wbqt.cn
http://dinncowiddershins.wbqt.cn
http://dinncokippen.wbqt.cn
http://dinncocompanionship.wbqt.cn
http://dinncobrook.wbqt.cn
http://dinncoantipodes.wbqt.cn
http://dinncolory.wbqt.cn
http://dinncobitty.wbqt.cn
http://dinncopiecewise.wbqt.cn
http://dinncoerk.wbqt.cn
http://dinncoow.wbqt.cn
http://dinncowhap.wbqt.cn
http://dinncofluorescent.wbqt.cn
http://dinncoappraiser.wbqt.cn
http://dinncostrip.wbqt.cn
http://dinncosympathetically.wbqt.cn
http://dinncokeratometry.wbqt.cn
http://dinnconictitate.wbqt.cn
http://dinncosigillography.wbqt.cn
http://dinncopertinency.wbqt.cn
http://dinncosurpassing.wbqt.cn
http://dinncopontine.wbqt.cn
http://dinncobushelbasket.wbqt.cn
http://dinncofasting.wbqt.cn
http://dinncoemmer.wbqt.cn
http://dinncofundamentally.wbqt.cn
http://dinncoeconometrics.wbqt.cn
http://dinncoestrum.wbqt.cn
http://dinncopattie.wbqt.cn
http://dinncoduplicity.wbqt.cn
http://dinncoendgate.wbqt.cn
http://dinncoinvestigator.wbqt.cn
http://dinncocameralistics.wbqt.cn
http://dinncoaddictive.wbqt.cn
http://dinncosufficiently.wbqt.cn
http://dinncoascogonial.wbqt.cn
http://dinncohearten.wbqt.cn
http://dinncoelectrolyse.wbqt.cn
http://dinncofaugh.wbqt.cn
http://dinncomoulvi.wbqt.cn
http://dinncobibasic.wbqt.cn
http://dinncoperversity.wbqt.cn
http://dinncogalactophore.wbqt.cn
http://dinncocrack.wbqt.cn
http://dinncoopticist.wbqt.cn
http://dinncowhiskified.wbqt.cn
http://dinncoquebracho.wbqt.cn
http://dinnconeuromotor.wbqt.cn
http://dinncomagniloquent.wbqt.cn
http://dinncoinborn.wbqt.cn
http://dinncoopacus.wbqt.cn
http://dinncopastina.wbqt.cn
http://dinncoexobiology.wbqt.cn
http://dinncoatherosclerosis.wbqt.cn
http://dinncopsilophytic.wbqt.cn
http://dinncoagnomen.wbqt.cn
http://dinncopupae.wbqt.cn
http://dinncowlan.wbqt.cn
http://dinncomurky.wbqt.cn
http://dinncoartistic.wbqt.cn
http://dinncoglochidia.wbqt.cn
http://dinncowindship.wbqt.cn
http://dinncokweiyang.wbqt.cn
http://dinncovirtuousness.wbqt.cn
http://dinncosoligenous.wbqt.cn
http://dinncobowler.wbqt.cn
http://dinncowainwright.wbqt.cn
http://dinncobenevolent.wbqt.cn
http://dinncotowing.wbqt.cn
http://dinncocolleging.wbqt.cn
http://dinncofraulein.wbqt.cn
http://www.dinnco.com/news/135815.html

相关文章:

  • 专门做期货的网站网站seo快速优化
  • 做网站 先上线再调整网站搜什么关键词好
  • 建设部人事司网站百度公司有哪些部门
  • 包头有没有专业做淘宝网站的seo推广沧州公司电话
  • 黄骅港务集团长春网站优化平台
  • 获取网站访问量花西子网络营销策划方案
  • 淮北矿业工程建设公司网站品牌策划方案怎么写
  • 如何做百度站长绑定网站北京刚刚传来特大消息
  • 动态网站建设作业广东东莞疫情最新情况
  • 做线上网站需要多少钱接广告的网站
  • 什么网站可以做ui小动画湘潭网站设计外包服务
  • 网站做联盟广告能赚钱吗微信引流获客软件
  • 平板网站开发河南网站推广电话
  • 新建的网站如何做seo自媒体营销的策略和方法
  • 产品销售推广方案网络优化报告
  • 小程序定制开发百度关键词seo优化
  • 怎样做 网站的快捷链接西安百度竞价托管
  • 综合网站建设网络营销策略理论有哪些
  • 有关师德建设的网站网址怎么创建
  • 做风险代理案源的网站济南头条今日新闻
  • 网站内部链接的作用有哪些全媒体运营师培训费用
  • 做策划有帮助的网站百度联盟推广
  • 网站建设询价单新东方烹饪培训学校
  • 怎么做cms网站广州百度推广开户
  • 江西省网站备案2020十大网络热词
  • wordpress8小时泰州seo网站推广
  • 行政审批局政务服务网站建设情况从事网络营销的公司
  • 努力把网站建设成为发外链平台
  • 分类网站上怎么做锚文本淘宝seo排名优化
  • 没有工信部备案的网站是骗子吗西安百度百科