使用Travis CI将Lektor站点部署到Github页面时出错

时间:2016-07-05 01:12:53

标签: travis-ci github-pages lektor

我有一个Lektor网站,我尝试使用Travis CI trigger approach from the Lektor docs自动部署以响应请求和提交。

Lektor配置在命令行中运行良好。

Travis构建启动,并且似乎构建了站点而没有问题 - 但是当它进入部署时,日志会显示以下内容:

Installing deploy dependencies
!!! Script support is experimental !!!

Preparing deploy
Cleaning up git repository with `git stash --all`. If you need build artifacts for deployment, set `deploy.skip_cleanup: true`. See https://docs.travis-ci.com/user/deployment/#Uploading-Files.
No local changes to save

Deploying application
Deploying to ghpages-https
  Build cache: /home/travis/.cache/lektor/builds/d3a411e13041731555222b901cff4248
  Target: ghpages+https://pybee/pybee.github.io?cname=pybee.org
  Initialized empty Git repository in /home/travis/build/pybee/pybee.github.io/temp/.deploytemp9xhRDc/scratch/.git/
  Fetching origin
  fatal: repository 'https://github.com/pybee/pybee.github.io/' not found
  error: Could not fetch origin
  fatal: repository 'https://github.com/pybee/pybee.github.io/' not found
Done!

要完整记录see here

我已检查Travis CI配置中的凭据以获取存储库;我尽可能肯定他们是正确的。我尝试过使用相同的配置(在本地导出LEKTOR_DEPLOY_USERNAMELEKTOR_DEPLOY_PASSWORD),它运行正常。

hammer:pybee.org rkm$ lektor deploy ghpages-https
Deploying to ghpages-https
  Build cache: /Users/rkm/Library/Caches/Lektor/builds/a269cf944d4302f15f78a1dfb1602486
  Target: ghpages+https://pybee/pybee.github.io?cname=pybee.org
  Initialized empty Git repository in /Users/rkm/projects/beeware/pybee.org/temp/.deploytempOh4p98/scratch/.git/
  Fetching origin
  From https://github.com/pybee/pybee.github.io
   * [new branch]      master     -> origin/master
  On branch master
  Your branch is up-to-date with 'origin/master'.
  nothing to commit, working directory clean
  Everything up-to-date
Done!

有关此错误原因的任何建议?

1 个答案:

答案 0 :(得分:2)

事实证明这是一个bug in Lektor

如果您在<project>.lektorproject中使用以下内容:

[servers.ghpages-https]
target = ghpages+https://pybee/pybee.github.io?cname=pybee.org

以及.travis.yml中的以下内容:

language: python
python: 2.7
cache:
  directories:
    - $HOME/.cache/pip
    - $HOME/.cache/lektor/builds
install: "pip install git+https://github.com/singingwolfboy/lektor.git@fix-ghpages-https-deploy#egg=lektor"
script: "lektor build"
deploy:
  provider: script
  script: "lektor deploy ghpages-https"
  on:
    branch: lektor

(即,使用PR分支进行部署),构建将按预期部署。