feat: 构建文件示例,重命名 lftp 脚本变量
This commit is contained in:
parent
aabd743a07
commit
00d893bb78
16
.gitlab-ci.yml.example
Normal file
16
.gitlab-ci.yml.example
Normal 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}
|
||||||
8
lftp.sh
8
lftp.sh
|
|
@ -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
|
||||||
Loading…
Reference in New Issue
Block a user