Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
[DEVOPS-779] simplify CI setup with buildkite hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
disassembler committed Jul 4, 2018
1 parent 65b3453 commit 3414b70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
7 changes: 1 addition & 6 deletions scripts/ci/nix-shell.sh → .buildkite/hooks/pre-command
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#!/bin/sh
# sh is really bash in this case
# shellcheck disable=SC2039

set -x

case $(uname -s | tr '[:upper:]' '[:lower:]') in
Expand All @@ -21,7 +17,6 @@ NIX_BUILD_SHELL="${NIX_BUILD_SHELL:-$NIX_PROFILE_BINPATH/bash}"

export NIX_REMOTE=daemon
NIX_PATH="nixpkgs=$(${NIX_BUILD} fetch-nixpkgs.nix -o nixpkgs)"
export PATH=$NIX_PROFILE_BINPATH:$PATH
export NIX_PATH
export NIX_BUILD_SHELL

${NIX_SHELL} -p nix bash coreutils zlib gmp ncurses "$@"
12 changes: 6 additions & 6 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
steps:
- label: 'hlint'
command: 'scripts/ci/nix-shell.sh -p hlint moreutils --run scripts/haskell/lint.sh'
command: 'nix-shell -p hlint moreutils --run scripts/haskell/lint.sh'
agents:
system: x86_64-linux

- label: 'stack2nix'
command: 'scripts/ci/nix-shell.sh -p cabal2nix stack cabal-install ghc moreutils expect -Q -j 4 --run scripts/check-stack2nix.sh'
command: 'nix-shell -Q -j 4 --run scripts/check-stack2nix.sh'
agents:
system: x86_64-linux

- label: 'cardano-x86_64-linux'
command: 'scripts/ci/nix-shell.sh --run scripts/ci/ci.sh'
command: 'nix-shell --run scripts/ci/ci.sh'
agents:
system: x86_64-linux

- label: 'cardano-x86_64-darwin'
command: 'scripts/ci/nix-shell.sh --run scripts/ci/ci.sh'
command: 'nix-shell --run scripts/ci/ci.sh'
agents:
system: x86_64-darwin

- label: 'release.nix'
command: 'scripts/ci/nix-shell.sh --run scripts/ci/check-hydra.sh'
command: 'nix-shell --run scripts/ci/check-hydra.sh'
agents:
system: x86_64-linux

- label: 'explorer frontend: checking generated dependencies'
command: 'scripts/ci/nix-shell.sh --run "cd explorer/frontend && ./nix/generate-frontend-deps.hs --test"'
command: "cd explorer/frontend && ./nix/generate-frontend-deps.hs --test"
agents:
system: x86_64-linux
2 changes: 1 addition & 1 deletion pkgs/generate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash
#!nix-shell -i bash -p bash cabal2nix stack cabal-install ghc

# regenerate the `pkgs/default.nix` file based on the current contents of cardano-sl.cabal and stack.yaml

Expand Down
3 changes: 2 additions & 1 deletion scripts/check-stack2nix.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git bash

# check and warn if `pkgs/default.nix` is out of date

Expand Down

0 comments on commit 3414b70

Please sign in to comment.