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

营销型网站改版百度登陆

营销型网站改版,百度登陆,广州开发区城市更新局,b站推广2023mmmK8S GitLab Jenkins自动化发布项目实践(一)发布流程设计安装Docker服务部署Harbor作为镜像仓库部署GitLab作为代码仓库常用Git命令发布流程设计 #mermaid-svg-pe9VmFytb9GmqMvG {font-family:"trebuchet ms",verdana,arial,sans-serif;font-…

K8S + GitLab + Jenkins自动化发布项目实践(一)

  • 发布流程设计
  • 安装Docker服务
  • 部署Harbor作为镜像仓库
  • 部署GitLab作为代码仓库
    • 常用Git命令

发布流程设计

Jenkins
Git
docker pull
docker pull
docker push
docker build
Unit Testing
git checkout
git commit
测试工程师
管理员
互联网用户
容器镜像
Harbor
测试环境
生产环境
kubectl API
Load Balance

由于之前部署的k8s集群已经升级到v1.24(容器运行时已经修改为containerd),这里我们单独准备一台服务器用于部署Harbor和GitLab。需要安装docker服务。

安装Docker服务

systemctl stop firewalld
systemctl disable firewalld
sed -i 's/enforcing/disabled/' /etc/selinux/config# 安装docker
yum install -y wget
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum -y install docker-ce-18.06.1.ce-3.el7
systemctl enable docker && systemctl start docker
docker --version

配置国内容器镜像仓库:

cat > /etc/docker/daemon.json << EOF
{"registry-mirrors": ["https://b9pmyelo.mirror.aliyuncs.com","http://hub-mirror.c.163.com/"],"insecure-registries": ["https://b9pmyelo.mirror.aliyuncs.com"],"exec-opts": ["native.cgroupdriver=systemd"]
}
EOF# 重启docker服务
systemctl restart docker

部署Harbor作为镜像仓库

本小节我们使用docker-compose来部署Harbor作为镜像仓库。

⛵️Harbor离线安装包下载地址:https://github.com/goharbor/harbor/releases
⛵️Harbor部署配置:https://goharbor.io/docs/2.7.0/install-config/
⛵️docker-compose安装包下载:https://github.com/docker/compose/releases/

准备工作:

mkdir /opt/harbor && cd /opt/harbor
mv /root/harbor-offline-installer-v2.5.6.tgz /opt/harbor
tar zxvf harbor-offline-installer-v2.5.6.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml 
vi harbor.yml
# -配置hostname为指定IP或者FQDN
# -配置admin用户密码harbor_admin_password
# -先注释https相关配置(生产环境不推荐)# 安装docker-compose
cp /root/docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose version

部署本地Harbor:

# 部署Harbor
cd /opt/harbor/harbor
./prepare   # 会生成一个docker-compose.yml
./install.sh  # 启动Harbor
docker-compose up -d
# 停止Harbor
docker-compose down -v

部署完检查:

# 需要在docker-compose.yml文件同级目录下执行
[root@harborgit harbor]# docker-compose psName                     Command                       State                          Ports
-----------------------------------------------------------------------------------------------------------------
harbor-core         /harbor/entrypoint.sh            Up (health: starting)
harbor-db           /docker-entrypoint.sh 96 13      Up (health: starting)
harbor-jobservice   /harbor/entrypoint.sh            Up (health: starting)
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up (health: starting)   127.0.0.1:1514->10514/tcp
harbor-portal       nginx -g daemon off;             Up (health: starting)
nginx               nginx -g daemon off;             Up (health: starting)   0.0.0.0:80->8080/tcp,:::80->8080/tcp
redis               redis-server /etc/redis.conf     Up (health: starting)
registry            /home/harbor/entrypoint.sh       Up (health: starting)
registryctl         /home/harbor/start.sh            Up (health: starting)

部署完成后,可以直接浏览器访问上面配置的hostname打开Harbor前端页面,使用admin用户登录。

在这里插入图片描述

部署GitLab作为代码仓库

⭐️官方地址:https://about.gitlab.com/install/#official-linux-package

使用docker部署GitLab:

mkdir /opt/gitlab
echo 'export GITLAB_HOME=/opt/gitlab' >> /root/.bash_profile
source /root/.bash_profile# 容器部署giltab(镜像名称放到最后)
docker run --detach --hostname gitlab.demo.com \--publish 443:443 --publish 88:80 --publish 2222:22 \--name gitlab --restart always \--volume $GITLAB_HOME/config:/etc/gitlab \--volume $GITLAB_HOME/logs:/var/log/gitlab \--volume $GITLAB_HOME/data:/var/opt/gitlab \gitlab/gitlab-ce

取决于镜像拉取的速度,部署完成大概需要3到5分钟。检查部署状态:

[root@harborgit harbor]# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                    PORTS                                                            NAMES
c0795ec3b34e        gitlab/gitlab-ce                     "/assets/wrapper"        5 minutes ago       Up 5 minutes (healthy)    0.0.0.0:443->443/tcp, 0.0.0.0:2222->22/tcp, 0.0.0.0:88->80/tcp   gitlab
3fa9ce8ec05d        goharbor/nginx-photon:v2.5.6         "nginx -g 'daemon of…"   14 minutes ago      Up 14 minutes (healthy)   0.0.0.0:80->8080/tcp                                             nginx
07f156592a2f        goharbor/harbor-jobservice:v2.5.6    "/harbor/entrypoint.…"   14 minutes ago      Up 14 minutes (healthy)                                                                    harbor-jobservice
3cfdec233a2c        goharbor/harbor-core:v2.5.6          "/harbor/entrypoint.…"   14 minutes ago      Up 14 minutes (healthy)                                                                    harbor-core
b3ae94a48b85        goharbor/harbor-registryctl:v2.5.6   "/home/harbor/start.…"   15 minutes ago      Up 14 minutes (healthy)                                                                    registryctl
00e7fc671a26        goharbor/registry-photon:v2.5.6      "/home/harbor/entryp…"   15 minutes ago      Up 14 minutes (healthy)                                                                    registry
b84e56987d36        goharbor/harbor-db:v2.5.6            "/docker-entrypoint.…"   15 minutes ago      Up 14 minutes (healthy)                                                                    harbor-db
faf6f9d624cb        goharbor/redis-photon:v2.5.6         "redis-server /etc/r…"   15 minutes ago      Up 14 minutes (healthy)                                                                    redis
f913b1c4c27c        goharbor/harbor-portal:v2.5.6        "nginx -g 'daemon of…"   15 minutes ago      Up 14 minutes (healthy)                                                                    harbor-portal
f964a7a7492a        goharbor/harbor-log:v2.5.6           "/bin/sh -c /usr/loc…"   15 minutes ago      Up 15 minutes (healthy)   127.0.0.1:1514->10514/tcp                                        harbor-log

部署完成后(容器状态为healthy),访问地址http://IP:88即可打开GitLab前端页面。初次登录需要设置root管理员用户密码。

获取管理员用户初始密码:

docker logs <gitlab容器ID> | grep initial_root_password
cat /opt/gitlab/config/initial_root_password

在这里插入图片描述

常用Git命令

# git全局设置
git config --global user.name "admin"
git config --global user.email "admin@example.com"# 创建一个新仓库
git clone git@gitlab.demos.com:root/java_demo.git
cd java_demo
touch README.md
git commit -m "add README"
git push -u origin master# 推送现有文件夹
cd existing_folder
git init
git remote add origin git@gitlab.demos.com:root/java_demo.git
git add .
git commit -m "Initial commit"
git push -u origin master# 推送现有Git仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin git@gitlab.demos.com:root/java_demo.git
git push -u origin --all
git push -u origin --tags
http://www.hkea.cn/news/314956/

相关文章:

  • 网站双倍浮动百度账号登陆入口
  • 聊城市网站建设网站推广排名
  • 帝国新闻网站模板百度seo推广怎么做
  • 预约做港澳证的网站网站排名在线优化工具
  • 罗湖实惠的网站建设费用成都官网seo厂家
  • 建设部官方网站有哪些优帮云排名优化
  • 天津做网站找谁新东方在线教育平台官网
  • 南宁做网站在哪了日本预测比分
  • 咋样查看网站用什么编程语言做的9个广州seo推广神技
  • 网站链接太多怎么做网站地图谷歌广告
  • 网站关键词更新临汾网络推广
  • 个人做网站靠什么盈利免费网站建设模板
  • 网站开发 打标签aso优化怎么做
  • 教育校园网站建设方案seo每天一贴
  • 怎么看网站的建设时间推广公司品牌
  • 营销型网站有什么特点英语培训机构
  • 学院网站的系统建设方式宝鸡网站seo
  • 网站客户端怎么做的百度一下了你就知道官网
  • 有什么推广方法优化大师电脑版官方
  • 自己做网站的服务器上海网站建设公司排名
  • 跳蛋塞逼做多的视频网站百度广告联盟官网
  • 房地产网站开发文档企业查询
  • 做emu对网站有什么要求十大免费无代码开发软件
  • 扬州专业做网站做关键词优化
  • 宿州网站建设贰聚思诚信网站服务器
  • 用照片做模板下载网站好百度爱采购官方网站
  • 微网站建设套餐网络营销是做什么的
  • 徐州有哪些做网站苏州网站建设费用
  • 统一企业信息管理系统网站直通车怎么开效果最佳
  • 武汉外贸网站建设公司外链相册