首页 > 解决方案 > Bitbucket Cloud Pipelines:如何将 Vue-Cli 应用程序部署到 bitbucket.io 作为静态 Web 主机?

问题描述

我的计划是使用 Bitbucket Cloud 作为我使用 Vue-Cli (VueJS) 构建的单页应用程序的静态 Web 主机

在此过程中,我想设置 Bitbucket 的 Pipeline 功能,以便我可以提交将自动部署到我的仓库的代码 https: <username>//.bitbucket.io

我正在尝试从我的单页应用程序部署生产版本,该应用程序具有用于部署的“/dist”文件夹。它包含用于静态 Web 托管工作的强制性 index.html 文件。

bitbucketBuild Setup步骤包含以下内容:

`git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/`
`git remote set-url origin http://bitbucket.org/<username>/<username>.bitbucket.io`

其中<username>包含我的实际 bitbucket 用户名

这是我的bitbucket-pipelines.yml

image: node:8.12.0

pipelines:
  default:
    - step:
caches:
  - node
script: 
  - npm install
  - npm rebuild node-sass
  - npm run build
  - cd dist
  - git add -A
  - git commit -m 'deploy build'
  - git push -f ${BITBUCKET_GIT_HTTP_ORIGIN} master
  - cd -

我在${BITBUCKET_GIT_HTTP_ORIGIN}这里正确使用了变量吗?

除了 STATUS: FAILED with nothing to commit 之外,我在 Bitbucket 的管道仪表板中没有收到错误:

    git commit -m 'deploy build'
+ git commit -m 'deploy build'
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

感谢任何人都可以提供的任何指示。

标签: bitbucketbitbucket-pipelinesvue-cli-3bitbucket-cloud

解决方案


推荐阅读