跳到主要内容

自动部署脚本

  1. 生产公钥私钥
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
  1. gitlab添加公钥

  2. 编辑脚本

vim mymq.sh
  • 脚本内容
#!/bin/bash

# Update the package list
echo "Updating package list"
sudo apt update

# Install Git
echo "Installing Git"
sudo apt install -y git

# Install JDK 1.8
echo "Installing JDK 1.8"
sudo apt install -y openjdk-8-jdk

# Install Maven 3.6.3

echo "Installing Maven 3.6.3"
sudo apt install -y maven


# Clone the repository
echo "Cloning the repository"
git clone git@gitlab.weihubeats.cn:weihubeats/rocketmq.git

# Print the success message
echo "Installation completed successfully!"
  1. 执行脚本
sh mymq.sh
  1. 编译
cd rocketmq

mvn -Prelease-all -DskipTests -Dspotbugs.skip=true clean install

# 不清理依赖缓存
# mvn -Prelease-all -DskipTests -Dspotbugs.skip=true install