简体   繁体   English

Gitlab CI/CD 意外行为

[英]Gitlab CI/CD unexpected behavior

i'm new to CD with gitlab and i wanted to do some test.我是 gitlab 的 CD 新手,我想做一些测试。 My.gitlab-ci.yml looks like this: My.gitlab-ci.yml 看起来像这样:

image: node:latest
before_script:
  - npm install -g @angular/cli
  - npm install
  - ng build --prod
  - apt-get update
  - apt-get install lftp
build:
  script:
    - lftp -e "set ftp:ssl-allow no;open $FTP_HOST ; user $FTP_USER $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose dist/ $FTP_ROOT; bye"

The code works and the files are sent to the server correctly.代码有效,文件正确发送到服务器。 The problem is that all the files are placed under a subdirectory created by the script.问题是所有文件都放在脚本创建的子目录下。 The subdirectory has the same name of the gitlab repository.该子目录与 gitlab 存储库同名。 The server root directory is not empty (maybe can this cause the problem?).服务器根目录不为空(也许这会导致问题?)。

What i'm doing wrong?我做错了什么? Thank you in advance先感谢您

Change mirror -X.* -X.*/ --reverse --verbose dist/ $FTP_ROOT to mirror -X.* -X.*/ --reverse --verbose dist/subdirectory $FTP_ROOT to place your angular app in www.example.com not in www.example.com/subdirectory (assuming $FTP_ROOT is the FTP server root -- I don't actually see where that is set).mirror -X.* -X.*/ --reverse --verbose dist/ $FTP_ROOTmirror -X.* -X.*/ --reverse --verbose dist/subdirectory $FTP_ROOT以将您的 angular 应用程序放在 www .example.com 不在 www.example.com/subdirectory 中(假设$FTP_ROOT是 FTP 服务器根目录——我实际上看不到它的设置位置)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM