File tree Expand file tree Collapse file tree 3 files changed +51
-15
lines changed
Expand file tree Collapse file tree 3 files changed +51
-15
lines changed Original file line number Diff line number Diff line change 1+ steps :
2+ - label : ' Update hackage.nix'
3+ command :
4+ - nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.09.tar.gz -A maintainer-scripts.update-hackage -o update-hackage.sh
5+ - echo "+++ Updating hackage.nix"
6+ - ./update-hackage.sh
7+ agents :
8+ system : x86_64-linux
9+
10+ - label : ' Update stackage.nix'
11+ command :
12+ - nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.09.tar.gz -A maintainer-scripts.update-stackage -o update-stackage.sh
13+ - echo "+++ Updating stackage.nix"
14+ - ./update-stackage.sh
15+ agents :
16+ system : x86_64-linux
Original file line number Diff line number Diff line change 44
55with stdenv . lib ;
66
7- writeScript "update-${ name } -nix.sh" ''
8- #!${ stdenv . shell }
7+ let
8+ repoHTTPS = "https://github.com/input-output-hk/${ name } .nix.git" ;
9+ repoSSH = "git@github.com:input-output-hk/${ name } .nix.git" ;
10+ sshKey = "/run/keys/buildkite-${ name } -ssh-private" ;
11+ in
12+ writeScript "update-${ name } -nix.sh" ''
13+ #!${ stdenv . shell }
914
10- set -euo pipefail
15+ set -euo pipefail
1116
12- export PATH="${ makeBinPath [ coreutils glibc git nix-tools cabal-install nix-prefetch-git ] } "
17+ export PATH="${ makeBinPath [ coreutils glibc git nix-tools cabal-install nix-prefetch-git ] } "
1318
14- ${ script }
19+ ${ script }
1520
16- git add .
17- git commit --allow-empty -m "Automatic update for $(date)"
21+ echo "Committing changes..."
22+ export GIT_COMMITTER_NAME="IOHK"
23+ export GIT_COMMITTER_EMAIL="devops+nix-tools@iohk.io"
24+ export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME"
25+ export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL"
26+ git add .
27+ git commit --allow-empty --message "Automatic update for $(date)"
1828
19- rev=$(git rev-parse HEAD)
29+ rev=$(git rev-parse HEAD)
2030
21- git push
31+ if [ -e ${ sshKey } ]
32+ then
33+ echo "Authenticating using SSH with ${ sshKey } "
34+ export GIT_SSH_COMMAND="ssh -i ${ sshKey } -F /dev/null"
35+ else
36+ echo "There is no SSH key at ${ sshKey } "
37+ echo "Git push may not work."
38+ fi
2239
23- cd ..
40+ git push ${ repoSSH }
2441
25- nix-prefetch-git https://github.com/input-output-hk/${ name } .nix.git --rev "$rev" | tee ${ name } -src.json
26- ''
42+ cd ..
43+
44+ nix-prefetch-git ${ repoHTTPS } --rev "$rev" | tee ${ name } -src.json
45+ ''
Original file line number Diff line number Diff line change 33import ./update-external.nix args {
44 name = "hackage" ;
55 script = ''
6- # Make sure the hackage index is recent.
7- cabal new-update
8-
96 # Clone or update the Hackage Nix expressions repo.
107 if [ -d hackage.nix ]; then
118 cd hackage.nix
@@ -15,6 +12,10 @@ import ./update-external.nix args {
1512 git clone git@github.com:input-output-hk/hackage.nix.git
1613 fi
1714
15+ # Make sure the hackage index is recent.
16+ echo "Updating local hackage index..."
17+ cabal update
18+
1819 echo "Running hackage-to-nix..."
1920
2021 hackage-to-nix hackage.nix
You can’t perform that action at this time.
0 commit comments