From 601d7ffebcd687cd831f08f9bad59dd4b578dce8 Mon Sep 17 00:00:00 2001 From: monlor Date: Sun, 7 Jan 2024 11:48:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E4=BD=BF=E7=94=A8rsync?= =?UTF-8?q?=E6=9D=A5=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epay/Dockerfile | 4 +++- epay/start.sh | 7 +++---- jenkins/plugins.txt | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/epay/Dockerfile b/epay/Dockerfile index 35cf322..29bc90a 100644 --- a/epay/Dockerfile +++ b/epay/Dockerfile @@ -2,7 +2,7 @@ FROM php:7.3-apache LABEL MAINTAINER me@monlor.com -LABEL VERSION 1.0.0 +LABEL VERSION 1.0.1 ENV TZ Asia/Shanghai @@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \ libmcrypt-dev \ libgdiplus \ openssl \ + rsync \ git && \ printf '\n' | pecl install mcrypt && \ docker-php-ext-enable mcrypt && \ @@ -28,6 +29,7 @@ WORKDIR /var/www/html # 下载v免签服务源代码并解压到镜像中 RUN git clone https://github.com/monlor/Epay-master /tmp/epay && \ + chmod -R 777 /tmp/epay && \ rm -rf /tmp/epay/.git # 开启伪静态支持 diff --git a/epay/start.sh b/epay/start.sh index c91128e..571ae1d 100644 --- a/epay/start.sh +++ b/epay/start.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + if [ -d /tmp/epay ]; then echo "更新epay文件..." if [ -f /var/www/html/install/install.lock ]; then @@ -7,10 +9,7 @@ if [ -d /tmp/epay ]; then cp -rf /var/www/html/install/install.lock /tmp/epay/install cp -rf /var/www/html/config.php /tmp/epay/config.php fi - rm -rf /var/www/html/{*,.*} &> /dev/null - mv /tmp/epay/{*,.*} /var/www/html &> /dev/null - chmod 777 -R /var/www/html + rsync -av --delete /var/www/html/ /tmp/epay/ &> /dev/null fi - apache2-foreground \ No newline at end of file diff --git a/jenkins/plugins.txt b/jenkins/plugins.txt index b561eba..8acee67 100644 --- a/jenkins/plugins.txt +++ b/jenkins/plugins.txt @@ -12,4 +12,5 @@ role-strategy matrix-auth pipeline-stage-view build-name-setter -build-user-vars-plugin \ No newline at end of file +build-user-vars-plugin +job-dsl \ No newline at end of file