代码拉取完成,页面将自动刷新
同步操作将从 xuxiaowei-cloud/xuxiaowei-cloud-next 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#
# shell 发布网关服务
shell-service-gateway:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- MODULE='gateway'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布监控(管理)服务
shell-service-admin-server:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- MODULE='admin-server'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布登录服务
shell-service-passport:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- MODULE='passport'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布MySQL二进制订阅服务
shell-service-canal:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='canal'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布用户服务
shell-service-user:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='user'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布主数据服务
shell-service-master-data:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='master-data'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-master-data.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布WebSocket服务
shell-service-websocket:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='websocket'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布WebService服务
shell-service-webservice:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='webservice'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布微信小程序服务
shell-service-wechat-miniprogram:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='wechat-miniprogram'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布微信公众号服务
shell-service-wechat-offiaccount:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='wechat-offiaccount'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布文件服务
shell-service-file:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- cd resource-services-parent
- pwd
- MODULE='file'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布 XXL Job
shell-service-xxl-job-admin:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- JAR_PATH=/home/gitlab-runner/jar/$CI_COMMIT_BRANCH
- echo JAR_PATH:$JAR_PATH
- if [ ! -f $JAR_PATH ]; then sudo mkdir $JAR_PATH -p && echo 创建发布文件夹完成; fi
- MODULE='xxl-job-admin'
- echo MODULE:$MODULE
- ARTIFACT_ID=`mvn -e -U help:evaluate -pl $MODULE -Dexpression=project.artifactId -q -DforceStdout`
- VERSION=`mvn help:evaluate -pl $MODULE -Dexpression=project.version -q -DforceStdout`
- PACKAGING=`mvn help:evaluate -pl $MODULE -Dexpression=project.packaging -q -DforceStdout`
- APP_NAME=$ARTIFACT_ID-$VERSION.$PACKAGING
- echo APP_NAME:$APP_NAME
- cp $MODULE/target/$APP_NAME $JAR_PATH/$APP_NAME && echo 复制新jar包完成
- SERVICE=/usr/lib/systemd/system/xxw-$MODULE.service
- echo SERVICE:$SERVICE
- JAVA_HOME=/software/dragonwell-17.0.6.0.6+9-GA
- echo JAVA_HOME:$JAVA_HOME
- echo "" > $SERVICE
- echo "[Unit]" >> $SERVICE
- echo "Description=$MODULE" >> $SERVICE
- echo "After=syslog.target" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Service]" >> $SERVICE
- echo "EnvironmentFile=/etc/profile" >> $SERVICE
- echo "ExecStart=$JAVA_HOME/bin/java -jar $JAR_PATH/$APP_NAME --spring.profiles.active=prod" >> $SERVICE
- echo "" >> $SERVICE
- echo "[Install]" >> $SERVICE
- echo "WantedBy=multi-user.target" >> $SERVICE
- echo "" >> $SERVICE
- echo 创建新启动脚本完成
- sudo systemctl enable xxw-$MODULE.service && echo 设置开机启动完成
- sudo systemctl daemon-reload
- sudo systemctl restart xxw-$MODULE.service && echo 重启项目完成
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
- MODULE_STATUS=0
- sleep 30 && echo 增加延时
- sudo systemctl status xxw-$MODULE.service && MODULE_STATUS=1
- if [ "$MODULE_STATUS" == "1" ]; then echo '延时查看项目状态成功'; else echo '查看项目状态失败' && xxxx; fi
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
#
# shell 发布UI服务
shell-service-ui:
stage: shell-service
needs:
- job: shell-package
artifacts: true
script:
- MODULE='ui'
- echo MODULE:$MODULE
- RELEASE_PATH=/home/gitlab-runner/node/$MODULE
- if [ ! -f $RELEASE_PATH ]; then sudo mkdir $RELEASE_PATH -p && echo 创建文件夹完成; fi
- echo RELEASE_PATH:$RELEASE_PATH
- if [ ! -f $RELEASE_PATH ]; then sudo mkdir $RELEASE_PATH -p && echo 创建发布文件夹完成; fi
- cp -r ./$MODULE/dist/* $RELEASE_PATH && echo 复制新文件夹完成
rules:
# 仅在 shell 分支中执行
# 此处禁用 gitlab.com、jihulab.com、gitcode.net 上的流水线,仅在个人搭建的 gitlab 上运行
- if: $CI_COMMIT_BRANCH == "shell" && $CI_SERVER_HOST != 'gitlab.com' && $CI_SERVER_HOST != 'jihulab.com' && $CI_SERVER_HOST != 'gitcode.net'
tags:
# 仅在 tags 名称为 shell 的执行器上执行
- shell
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。