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

fix postfix apt installation & remove ** usage so cabal copy works. #826

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ RUN apt-add-repository ppa:hvr/ghc
RUN apt-get update

# Dependencies
RUN apt-get install -yy unzip libicu-dev postfix
RUN apt-get install -y ghc-8.2.1 cabal-install-2.0
RUN DEBIAN_FRONTEND=noninteractive apt-get install -yy unzip libicu-dev postfix
RUN apt-get install -y ghc-8.2.2 cabal-install-2.4
ENV PATH /opt/ghc/bin:$PATH
RUN cabal update
RUN cabal v2-update

# Required Header files
RUN apt-get install -y zlib1g-dev libssl-dev
Expand All @@ -35,13 +35,11 @@ RUN apt-get install -y zlib1g-dev libssl-dev
RUN mkdir /build
WORKDIR /build
ADD ./hackage-server.cabal ./hackage-server.cabal
RUN cabal sandbox init
# TODO: Switch to Nix-style cabal new-install
RUN cabal install --only-dependencies --enable-tests -j --force-reinstalls
ENV PATH /build/.cabal-sandbox/bin:$PATH
RUN cabal v2-install -j --force-reinstalls
ENV PATH /root/.cabal/bin:$PATH

# needed for creating TUF keys
RUN cabal install hackage-repo-tool
RUN cabal v2-install hackage-repo-tool

# add code
# note: this must come after installing the dependencies, such that
Expand All @@ -56,13 +54,13 @@ RUN hackage-repo-tool create-root --keys keys -o datafiles/TUF/root.json
RUN hackage-repo-tool create-mirrors --keys keys -o datafiles/TUF/mirrors.json

# build & test & install hackage
RUN cabal configure -f-build-hackage-mirror --enable-tests
RUN cabal build
RUN cabal v2-configure -f-build-hackage-mirror --enable-tests
RUN cabal v2-build
# tests currently don't pass: the hackage-security work introduced some
# backup/restore errors (though they look harmless)
# see https://github.com/haskell/hackage-server/issues/425
#RUN cabal test
RUN cabal copy && cabal register
RUN cabal v2-install all

# setup server runtime environment
RUN mkdir /runtime
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ you can find these as the file names of the files created in
`signed.roles.root.keyids`). An example `cabal` client configuration might look
something like

remote-repo my-private-hackage
repository my-private-hackage
url: http://example.com:8080/
secure: True
root-keys: 865cc6ce84231ccc990885b1addc92646b7377dd8bb920bdfe3be4d20c707796
Expand Down
20 changes: 13 additions & 7 deletions hackage-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ tested-with: GHC ==8.4.4 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3

data-dir: datafiles
data-files:
templates/**/*.st

static/**/*.css
static/**/*.js
static/**/*.svg
static/**/*.png
static/**/*.ico
templates/AdminFrontend/*.st
templates/EditCabalFile/*.st
templates/Html/*.st
templates/LegacyPasswds/*.st
templates/Search/*.st
templates/UserSignupReset/*.st
templates/Users/*.st

static/datatables/*.css
static/datatables/*.js
static/icons/*.svg
static/images/*.png
static/*.ico

TUF/README.md
TUF/mirrors.json
Expand Down