Skip to content

Commit

Permalink
feat: 🎸 使用rsync来更新文件
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Jan 7, 2024
1 parent f7e4f50 commit 601d7ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion epay/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM php:7.3-apache

LABEL MAINTAINER [email protected]
LABEL VERSION 1.0.0
LABEL VERSION 1.0.1

ENV TZ Asia/Shanghai

Expand All @@ -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 && \
Expand All @@ -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

# 开启伪静态支持
Expand Down
7 changes: 3 additions & 4 deletions epay/start.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/bin/bash

set -e

if [ -d /tmp/epay ]; then
echo "更新epay文件..."
if [ -f /var/www/html/install/install.lock ]; then
echo "检测到历史文件,恢复中..."
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
3 changes: 2 additions & 1 deletion jenkins/plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ role-strategy
matrix-auth
pipeline-stage-view
build-name-setter
build-user-vars-plugin
build-user-vars-plugin
job-dsl

0 comments on commit 601d7ff

Please sign in to comment.