使用 Travis CI 将 Lektor 站点部署到 Github 页面时出错
Error when deploying Lektor site to Github Pages using Travis CI
我有一个 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_USERNAME
和 LEKTOR_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!
关于这个错误的原因有什么建议吗?
原来这是一个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 分支进行部署),构建将按预期部署。
我有一个 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_USERNAME
和 LEKTOR_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!
关于这个错误的原因有什么建议吗?
原来这是一个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 分支进行部署),构建将按预期部署。