Compare commits

..

No commits in common. "aa1fa6d1d7b375a3338bf11207953050bb15527d" and "37407d45ad57a80613e70d5affaed0e32d5b655e" have entirely different histories.

1 changed files with 10 additions and 8 deletions

View File

@ -25,7 +25,8 @@ build-job:
# 编译
- echo '编译'
- go env -w GO111MODULE=off
- while IFS= read -r line
- |
while IFS= read -r line
do
cd $line
echo "编译 $line"
@ -33,7 +34,7 @@ build-job:
cd ..
done < shell/programs.txt
save-job:
deploy-job:
stage: save
only:
- develop
@ -48,20 +49,22 @@ save-job:
- cp -rfp ./data/* ./temp/data
# 删除自定义配置
- echo '删除自定义配置'
- while IFS= read -r line
- |
while IFS= read -r line
do
echo "删除 $line 配置"
rm ./temp/data/$line
done < ./shell/exclude.txt
# 拷贝可执行程序
- echo '拷贝可执行程序'
- while IFS= read -r line
- |
while IFS= read -r line
do
echo "拷贝 $line"
mv ./$line/$line ./temp/$line
done < ./shell/programs.txt
sync_job:
push_job:
stage: sync
only:
- develop
@ -80,15 +83,14 @@ sync_job:
echo "不支持的分支";
exit 1;
fi
- echo "$REMOTE_HOST"
- echo "Setting up SSH keys..."
# 设置 .ssh 目录并写入 SSH 私钥
- echo "设置 SSH keys..."
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H "$REMOTE_HOST" >> ~/.ssh/known_hosts
# 使用 rsync 将文件同步到远程服务器
- echo "同步到服务器"
- echo "Deploying to remote server using rsync..."
- rsync -avz --delete ./temp $REMOTE_USER@$REMOTE_HOST:$REMOTE_DEPLOY_PATH