CICD搭建部署
2024-01-10 22:31:19 0 举报
AI智能生成
CICD过程中的各类工具搭建部署
作者其他创作
大纲/内容
centos安装下基本的工具
yum install -y wget
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
yum install -y vim
yum install -y lrzsz
systemctl stop firewalld && systemctl disable firewalld
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum install -y ntp
ntpdate ntp.aliyun.com
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
yum install -y vim
yum install -y lrzsz
systemctl stop firewalld && systemctl disable firewalld
setenforce 0 && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum install -y ntp
ntpdate ntp.aliyun.com
gitlab
gitlab安装部署
Maven
Maven安装部署
镜像仓库
harbor
nexus
jenkins搭建部署
jenkins常用安装方法
直接下载war包安装
安装java
yum install -y java-11-openjdk
下载地址:http://mirrors.jenkins.io/war-stable/latest/jenkins.war
启动jenkins
java -jar jenkins.war
打开页面访问即可IP:8080
根据页面上提供的路径获取下密码输入进去即可
这个方式看起来会一直在前台运行这个进程,一旦关闭jenkins就会停止,我这边试了下将这个进程放后台运行即可
nohup java -jar jenkins.war &
通过rpm包安装
安装java
yum install -y java-11-openjdk
下载rpm包
下载对应版本的rpm包
rpm -ivh jenkins-2.387.3-1.1.noarch.rpm
systemctl start jenkins
访问jenkins服务
添加jenkins的yum源,通过yum安装
安装java
yum install -y java-11-openjdk
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo --no-check-certificate
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum list | grep jenkins
yum install -y jenkins
systemctl start jenkins
systemctl enable jenkins
cat /var/lib/jenkins/secrets/initialAdminPassword
下一步下一步即可
docker方式安装
docker直接安装
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum clean all && yum repolist && yum makecache
yum install -y docker-ce
systemctl enable docker.service --now
docker pull jenkins/jenkins:lts
docker images
mkdir -p ~/opt/docker/jenkins && cd ~/opt/docker/jenkins
mkdir {data,config,logs}
docker run \
-u root \
--rm \
-d \
-p 8080:8080 \
-p 50000:50000 \
-v /opt/docker/jenkins/data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
--name jenkins \
jenkins/jenkins:lts
-u root \
--rm \
-d \
-p 8080:8080 \
-p 50000:50000 \
-v /opt/docker/jenkins/data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
--name jenkins \
jenkins/jenkins:lts
docker compose 安装
0 条评论
下一页