update scripts

This commit is contained in:
Zhang Peng 2019-02-22 17:09:40 +08:00
parent 3979cb6daf
commit 700d814e0d
14 changed files with 73 additions and 22 deletions

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
###################################################################################
# Linux Centos 环境部署脚本
# Linux CentOS 环境部署脚本
# Author: Zhang Peng
###################################################################################
function printHeadInfo() {
cat << EOF
***********************************************************************************
* Welcome to using the deployment script for Centos.
* Welcome to using the deployment script for CentOS.
* Author: Zhang Peng
***********************************************************************************
EOF

View File

@ -0,0 +1,14 @@
# 脚本使用说明
## 安装 Git
执行 yum install -y git 即可。
## 安装 Gitlab
使用方法:执行以下任意命令即可执行脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/git/install-gitlab.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/git/install-gitlab.sh | bash
```

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
echo -e "\n>>>>>>>>> install git"
yum -y install git

View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
###################################################################################
# 安装 Gitlab 脚本
# 仅适用于 CentOS7 发行版本
# Author: Zhang Peng
###################################################################################
echo -e "\n>>>>>>>>> install gitlab"
echo -e "\n>>>>>>>>> 安装和配置必要依赖"
sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
echo -e "\n>>>>>>>>> 安装和配置邮件服务"
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
echo -e "\n>>>>>>>>> 通过 yum 安装 gitlab"
curl -o- https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" yum install -y gitlab-ce

View File

@ -1,4 +1,6 @@
# 安装 JDK
# 脚本使用说明
## 安装 JDK
使用方法:执行以下任意命令即可执行脚本。

View File

@ -2,7 +2,7 @@
###################################################################################
# 安装 JDK8 脚本
# 仅适用于所有 Centos 发行版本
# 仅适用于所有 CentOS 发行版本
# JDK 会被安装到 /usr/lib/jvm/java 路径。
# Author: Zhang Peng
###################################################################################

View File

@ -1,9 +1,12 @@
# 安装 Kafka
# 脚本使用说明
使用方法:
## 安装 Kafka
使用方法:执行以下任意命令即可执行脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/kafka/install-kafka.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/kafka/install-kafka.sh | bash
```
脚本会下载解压 kafka 到 `/opt/kafka` 路径下。

View File

@ -1,11 +1,14 @@
# 安装 Maven
# 脚本使用说明
使用方法:
## 安装 Maven
使用方法:执行以下任意命令即可执行脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/maven/install-maven3.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/maven/install-maven3.sh | bash
```
脚本会下载解压 maven 到 `/opt/maven` 路径下。
如果需要使用国内镜像(如 aliyun 镜像)加速,可以使用 settings-aliyun.xml 替换默认 settings.xml
备份并替换 settings.xml本目录中的 settings-aliyun.xml使用 aliyun 镜像加速 maven

View File

@ -17,8 +17,17 @@ version=3.5.4
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.tar.gz
tar -zxvf apache-maven-${version}-bin.tar.gz
# 设置环境变量
cat >> /etc/profile << EOF
export MAVEN_HOME=/opt/maven/apache-maven-${version}
export MAVEN_HOME=/opt/maven/apache-maven-3.5.4
export PATH=\$MAVEN_HOME/bin:\$PATH
EOF
source /etc/profile
# 备份并替换 settings.xml使用 aliyun 镜像加速 maven
echo -e "\n>>>>>>>>> replace /opt/maven/apache-maven-${version}/conf/settings.xml"
cp /opt/maven/apache-maven-${version}/conf/settings.xml /opt/maven/apache-maven-${version}/conf/settings.xml.bak
wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/maven/settings-aliyun.xml -O /opt/maven/apache-maven-${version}/conf/settings.xml
# 回到初始目录
cd -

View File

@ -2,7 +2,7 @@
###################################################################################
# 安装 nginx 脚本
# 仅适用于 centos 发行版本。
# 仅适用于 CentOS 发行版本。
# Author: Zhang Peng
###################################################################################

View File

@ -2,7 +2,7 @@
###################################################################################
# 安装 nginx 脚本
# 仅适用于 centos 发行版本。
# 仅适用于 CentOS 发行版本。
# Author: Zhang Peng
###################################################################################

View File

@ -2,7 +2,7 @@
###################################################################################
# 安装 zsh、oh-my-zsh 脚本
# 适用于 Centos
# 适用于 CentOS
# Author: Zhang Peng
###################################################################################

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
###################################################################################
# Linux Centos 环境初始化脚本(设置环境配置、安装基本的命令工具)
# Linux CentOS 环境初始化脚本(设置环境配置、安装基本的命令工具)
# Author: Zhang Peng
###################################################################################

View File

@ -2,7 +2,7 @@
###################################################################################
# 本脚本用于替换 yum repo使用国内 yum 仓库,加速下载
# 要求:仅适用于 Linux Centos 发行版本,并且环境必须已支持 yum 、lsb_release 命令
# 要求:仅适用于 Linux CentOS 发行版本,并且环境必须已支持 yum 、lsb_release 命令
# Author: Zhang Peng
###################################################################################
@ -17,7 +17,7 @@ version=`cat /etc/redhat-release | awk '{print substr($4,1,1)}'`
# 根据发型版本选择相应 yum 镜像
if [ ${version} == 5 ]; then
# Cento5 已废弃,只能使用 http://vault.centos.org/ 替换,但由于是国外镜像,速度较慢
# Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢
wget --no-cookie --no-check-certificate -O /etc/yum.repos.d/CentOS-Base.repo https://github.com/dunwu/os-tutorial/master/codes/deploy/sys/yum/CentOS-Base.repo
# 根据实际发型版本情况替换
@ -28,7 +28,7 @@ if [ ${version} == 5 ]; then
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo
else
# 国内 aliyun 镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-${version}.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/CentOS-${version}.repo
# 国内 163 镜像(备选)
#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS${version}-Base-163.repo