基于Docker和Jenkins的CI改造
source link: https://panda843.github.io/article/4226450635.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
基于Docker和Jenkins的CI改造
持续集成是一种软件开发实践,对于提高软件开发效率并保障软件开发质量提供了理论基础,旨在提供一个开放易用的软件平台,使持续集成变成可能。为了以后方便现在把博客迁移到了Docker上面,由于只有一台机器所以这里就没有使用Docker Registry了
/root/work |
Docker
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
安装Docker
yum install docker |
service docker start |
Jenkins
Jenkins是一个开源软件项目,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能。
安装Jenkins
docker pull docker.io/jenkins |
启动Jenkins的容器服务
docker run -d --name jenkins -p 127.0.0.1:8080:8080 -p 127.0.0.1:50000:50000 -v /root/jenkins:/var/jenkins_home jenkins |
Dockerfile
博客的基础镜像lenoate_env
由于使用的开发版本的leanote所以自己构建了一个golang的开发环境
#系统 |
博客的打包镜像
leanote自动构建的dockerfile
FROM leanote_env |
自动升级脚本
update_blog_docker.sh
#!/bin/bash |
nginx配置
# 这里是blog的http解析配置 |
配置Jenkins
Jenkins需要安装插件Git plugin,SSH plugin
GitHub-Api的Token获取
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK