Skip to content

Commit

Permalink
Build hydra-tui in hydra CI and as docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Sep 24, 2021
1 parent d90ac48 commit a37319c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
*

!*.nix
!/nix

!cabal.project
!/hydra-node
!/hydra-plutus
!/hydra-prelude
!/local-cluster

dist-newstyle/
/.direnv/
/.github
/dist-newstyle/
*.sock
*.socket
*.eventlog
*.hp
*.prof
*.hi
*.o
/test-results.xml
2 changes: 1 addition & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os: [ ubuntu-20.04 ]
repository: [ inputoutput/hydra ]
target: [ hydra-node, mock-chain, hydra-pab ]
target: [ hydra-node, hydra-tui, mock-chain, hydra-pab ]

runs-on: ${{ matrix.os }}
steps:
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ RUN echo "substituters = https://cache.nixos.org https://iohk.cachix.org https:/
COPY . .

RUN nix-build -A hydra-node -o hydra-node-result release.nix > hydra-node.drv
RUN nix-build -A hydra-tui -o hydra-tui-result release.nix > hydra-tui.drv
RUN nix-build -A mock-chain -o mock-chain-result release.nix > mock-chain.drv
RUN nix-build -A hydra-pab -o hydra-pab-result release.nix > hydra-pab.drv

RUN nix-store --export $(nix-store -qR $(cat hydra-node.drv)) > hydra-node.closure
RUN nix-store --export $(nix-store -qR $(cat hydra-tui.drv)) > hydra-tui.closure
RUN nix-store --export $(nix-store -qR $(cat mock-chain.drv)) > mock-chain.closure
RUN nix-store --export $(nix-store -qR $(cat hydra-pab.drv)) > hydra-pab.closure

Expand All @@ -33,6 +35,17 @@ RUN nix-store --import < hydra-node.closure && nix-env -i $(cat hydra-node.drv)

ENTRYPOINT ["hydra-node"]

# ------------------------------------------------------------------- HYDRA-TUI

FROM nixos/nix:2.3.11 as hydra-tui

COPY --from=build /build/hydra-tui.drv hydra-tui.drv
COPY --from=build /build/hydra-tui.closure hydra-tui.closure

RUN nix-store --import < hydra-tui.closure && nix-env -i $(cat hydra-tui.drv)

ENTRYPOINT ["hydra-tui"]

# ------------------------------------------------------------------- MOCK-CHAIN

FROM nixos/nix:2.3.11 as mock-chain
Expand Down
1 change: 1 addition & 0 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ in

# Build executables only (for now)
hydra-node = hsPkgs.hydra-node.components.exes.hydra-node;
hydra-tui = hsPkgs.hydra-tui.components.exes.hydra-tui;
mock-chain = hsPkgs.hydra-node.components.exes.mock-chain;
hydra-pab = hsPkgs.hydra-plutus.components.exes.hydra-pab;
}

0 comments on commit a37319c

Please sign in to comment.