如何使用基于容器的基础架构从 Travis CI 自动部署?

How do I automatically deploy from Travis CI with the container-based infrastructure?

当我使用Travis CI "container-based" infrastructure时,我必须有

sudo: false

my .travis.yml; but this appears to be incompatible with automatic deployment中设置,例如

deploy:
  provider: hackage

这导致我的构建失败

Installing deploy dependencies
sudo: must be setuid root

如何将 Travis CI 的自动部署与基于容器的基础架构一起使用?


构建日志的最后几行,从成功完成代码构建和测试开始是:

The command "stack $ARGS --no-terminal --install-ghc test --haddock" exited with 0.
#cache.2
store build cache
83.58schanges detected, packing new archive
.
#...
.
uploading archive
#dpl.0
Fetching: dpl-1.8.7.gem (100%)
Successfully installed dpl-1.8.7
1 gem installed
#dpl.1
Installing deploy dependencies
sudo: must be setuid root
#dpl.2
Preparing deploy
No stash found.
cabal check failed
failed to deploy

使用 Travis CI "container-based" 基础设施是不可能的,because Hackage 依赖于 cabal,这需要 sudo.