feat: 构建文件示例,重命名 lftp 脚本变量

This commit is contained in:
Tsukasa 2019-05-11 09:08:30 +08:00
parent aabd743a07
commit 00d893bb78
2 changed files with 20 additions and 4 deletions

16
.gitlab-ci.yml.example Normal file
View File

@ -0,0 +1,16 @@
variables:
HOST: ftp.host
USER: ftp.username
PASSWD: ftp.passoword
LOCAL_DIR: local/dir
REMOTE_DIR: remote/dir
stages:
- build
cache:
key: ${CI_BUILD_REF_NAME}
paths:
- path/cache
build_production:
stage: build
script:
- bash ./scripts/lftp.sh ${HOST} ${USER} ${PASSWD} ${LOCAL_DIR} ${REMOTE_DIR}

View File

@ -7,11 +7,11 @@ user=$2
#ftp密码 #ftp密码
password=$3 password=$3
#要上传的文件夹 #要上传的文件夹
updir=$4 localdir=$4
#目标文件夹 #目标文件夹
todir=$5 remotedir=$5
lftp -u $user,$password $host<<EOF lftp -u $user,$password $host<<EOF
mkdir $todir mkdir $remotedir
mirror -R $updir $todir mirror -R $localdir $remotedir
EOF EOF