Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use 'deploy' with the container-based infrastructure #5033

Closed
orome opened this issue Oct 30, 2015 · 3 comments
Closed

Can't use 'deploy' with the container-based infrastructure #5033

orome opened this issue Oct 30, 2015 · 3 comments

Comments

@orome
Copy link

orome commented Oct 30, 2015

When I use the Travis CI "container-based" infrastructure, I must have

sudo: false

set in my .travis.yml; but this appears to be incompatible with automatic deployment using, for example

deploy:
  provider: hackage

which causes my build to fail with

Installing deploy dependencies
sudo: must be setuid root

How can I use automatic deployment from Travis CI with the container-based infrastructure?

@orome
Copy link
Author

orome commented Oct 30, 2015

The offending .travis.yml:

# Use new container infrastructure to enable caching
sudo: false

# Choose a lightweight base image; we provide our own build tools.
language: c

# GHC depends on GMP. You can add other dependencies here as well.
addons:
  apt:
    packages:
    - libgmp-dev

# The different configurations we want to test. You could also do things like
# change flags or use --stack-yaml to point to a different file.
env:
- ARGS="--resolver lts-3.7"
- ARGS="--resolver nightly"
#- ARGS=""

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v0.1.4.0/stack-0.1.4.0-x86_64-linux.tar.gz | tar xz -C ~/.local/bin

# This line does all of the work: installs GHC if necessary, build the library,
# executables, and test suites, and runs the test suites. --no-terminal works
# around some quirks in Travis's terminal implementation.
script: stack $ARGS --no-terminal --install-ghc test --haddock

# Caching so the next build will be fast too.
cache:
  directories:
  - "$HOME/.stack"

# Deploy (tagged commits) to Hackage; generated by travis CLI
before_deploy: "echo '=== BEGIN deployment ==='"
deploy:
  provider: hackage
  username: Orome
  password:
    secure: #...
  on:
    repo: orome/crypto-enigma-hs
    branch: hackage
    tags: true
after_deploy: "echo '=== END deployment ==='"

@BanzaiMan
Copy link
Contributor

hackage provider depends on cabal, which requires sudo, so you can't use it on containers.

Please use the legacy infrastructure, or Trusty.

@orome
Copy link
Author

orome commented Oct 30, 2015

@BanzaiMan — When I switch to legacy infrastructure, I get

Installing deploy dependencies
E: Unable to locate package cabal

Can you help quickly point out what I'm missing and need to do to fix that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants