create-react-app react-cicd
cd /usr/local/src
wget http://upload-markdown-images.oss-cn-beijing.aliyuncs.com/jdk1.8.0_211.tar.gz
tar -xzvf jdk1.8.0_211.tar.gz
mkdir /usr/java
cp -r /usr/local/src/jdk1.8.0_211 /usr/java
ln -s /usr/java/jdk1.8.0_211/bin/java /usr/bin/java
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install -y jenkins
systemctl stop firewalld.service
systemctl disable firewalld.service
npm config set registry http://registry.npm.taobao.org/ &&
npm install &&
npm -rf build &&
npm run build
vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
安装nginx
yum install nginx -y
Publish over SSH
ssh-keygen -t rsa
ssh-copy-id 192.168.1.2
npm config set registry http://registry.npm.taobao.org/ &&
npm install &&
npm -rf build &&
npm run build
cd build&&
tar -zcvf build.tar.gz *
cd /usr/share/nginx/html &&
tar -xzvf build.tar.gz &&
rm -rf build.tar.gz