【发布时间】:2019-11-30 20:43:05
【问题描述】:
我最近开始使用 Bitbucket Pipelines 处理 CI。我已经设法使用我的 SFTP 服务器进行连接,创建 API 公钥和私钥并使用 SSH 将它们添加到我的服务器。
现在,当我运行构建时,它会将我的所有文件上传到正确的文件夹。但是我遇到了一个问题,即从脚本“yarn build”运行 package.json 命令完全没有做任何事情。根文件夹中没有任何内容。
我错过了什么或做错了什么?本地一切正常,上传文件也是如此。
我的 bitbucket-pipeline.yaml:
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
branches:
develop:
- step:
name: Lets push the data to the Server.
caches:
- node
script:
- pipe: atlassian/sftp-deploy:0.4.1
variables:
USER: $SFTP_username
PASSWORD: $SFTP_password
SERVER: $SFTP_host
REMOTE_PATH: /var/www/html/pipeline-http/test-website/
DEBUG: 'true'
- step:
name: Build and test website and deploy.
caches:
- node
script:
- yarn install
- yarn test-build
artifacts:
- assets/**
【问题讨论】:
-
根文件夹里什么都没有是什么意思?
-
Druze,当我在我的计算机上运行“yarn test-build”时,Webpack 将创建一个包含已编译的 CSS 和 JS 文件的“assets”文件夹。但是,当我使用 CI 运行它并运行命令时,不会创建文件夹或根本不存在文件。
-
你解决了这个问题吗,我最近遇到了完全相同的问题。
标签: bitbucket bitbucket-pipelines