安装配置环境
环境:
CentOS 7.5
JDK 1.8(优先安装)
python 2.7.5
git 1.8.3.1
Jenkins 2.235
MariaDB 10.4.13
JFrog 7.6.3
Gradle 4.7
安装Jenkins
1.wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat/jenkins-2.236-1.1.noarch.rpm
2.rpm -ivh jenkins-2.236-1.1.noarch.rpm
或
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
3.修改vi /etc/init.d/jenkins文件,在/usr/bin/java后面增加/usr/local/jdk/jdk1.8/bin/java
3.1 systemctl daemon-reload
4.systemctl start/stop/restart jenkins //启动Jenkins
5.访问地址:http://IP:8080/
6.cat /var/lib/jenkins/secrets/initialAdminPassword 输入密码
备注:
7.选择“Install suggested plugins”安装默认的插件
8.上面安装完插件之后,需要设置一个管理员用户admin/admin
安装Maven
// 安装yum配置工具
# yum install -y yum-utils
// 使用配置工具配置第三方epel源仓库
# yum-config-manager --add-repo http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo
# yum-config-manager --enable epel-apache-maven
// 安装maven
# yum install -y apache-maven
安装JFrog
推荐用使用RPM包安装JFrog Artifactory,便于更新。安装前提也是已经安装了java环境。
1.安装和配置数据库。数据库可不安装,用默认的
cat >/etc/yum.repos.d/MariaDB.repo<<EOF
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
2.sudo yum makecache fast //更新yum缓存索引
3.sudo yum -y install MariaDB-server MariaDB-client//使用yum软件包管理器安装MariaDB 10.4
4.查看安装的信息,rpm -qi MariaDB-server
5.启动并启用MariaDB服务:sudo systemctl enable --now mariadb
6.现在在CentOS 7上安装了MariaDB 10.4,通过运行mysql_secure_installation来保护它: mysql_secure_installation
前面是N,后面都是Y
7.mysql -u root -p
8.还可以使用以下命令来检查版本:
#mysql -V
1.添加JFrog Artifactory RPM存储库
JFrog Artifactory包可在官方存储库中找到,通过运行以下命令添加:curl -sL https://bintray.com/jfrog/artifactory-rpms/rpm | sudo tee /etc/yum.repos.d/bintray-jfrog-artifactory-rpms.repo
2.在CentOS 7上安装JFrog Artifactory
1、安装JFrog Artifactory OSS:
sudo yum -y install jfrog-artifactory-oss wget
2、安装JFrog Artifactory CE:这个是企业版
sudo yum -y install jfrog-artifactory-cpp-ce wget
3.systemctl start artifactory.service
systemctl status artifactory.service
jfrog默认的端口是8081,默认的用户名和密码是:admin/password。
4.访问地址:http://IP:8081/
安装JFrog-pro Docker的方式
1.mkdir -p $JFROG_HOME/artifactory/var/etc/
2.cd $JFROG_HOME/artifactory/var/etc/
3.touch ./system.yaml
4.chown -R 1030:1030 $JFROG_HOME/artifactory/var
5.docker run --name artifactory -v $JFROG_HOME/artifactory/var/:/var/opt/jfrog/artifactory -d -p 8081:8081 -p 8082:8082 docker.bintray.io/jfrog/artifactory-<pro|oss|cpp-ce>:latest
访问地址:http://ip:8089 用户名admin/123456
安装Gradle
1.查找对应版本的gradle,官网目前是下载不了
2.解压并配置环境变量,export PATH=$PATH:/usr/local/gradle-4.7/bin
3.测试安装结果gradle -v