File tree Expand file tree Collapse file tree 1 file changed +25
-12
lines changed Expand file tree Collapse file tree 1 file changed +25
-12
lines changed Original file line number Diff line number Diff line change 4
4
5
5
with stdenv . lib ;
6
6
7
- writeScript "update-${ name } -nix.sh" ''
8
- #!${ stdenv . shell }
7
+ let
8
+ repo = "github.com/input-output-hk/${ name } .nix.git" ;
9
+ tokenFile = "/run/keys/buildkite-nix-tools-token" ;
10
+ githubUser = "iohk-devops" ;
11
+ in
12
+ writeScript "update-${ name } -nix.sh" ''
13
+ #!${ stdenv . shell }
9
14
10
- set -euo pipefail
15
+ set -euo pipefail
11
16
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 ] } "
13
18
14
- ${ script }
19
+ ${ script }
15
20
16
- git add .
17
- git commit --allow-empty -m "Automatic update for $(date)"
21
+ git add .
22
+ git commit --allow-empty -m "Automatic update for $(date)"
18
23
19
- rev=$(git rev-parse HEAD)
24
+ rev=$(git rev-parse HEAD)
20
25
21
- git push
26
+ if [ -f ${ tokenFile } ];
27
+ echo "Authenticating as ${ githubUser } "
28
+ auth="${ githubUser } :$(head -n1 ${ tokenFile } )@"
29
+ else
30
+ echo "There is no GitHub token in ${ tokenFile } "
31
+ auth=""
32
+ fi
22
33
23
- cd ..
34
+ git push "https:// '' ${auth} ${ repo } "
24
35
25
- nix-prefetch-git https://github.com/input-output-hk/${ name } .nix.git --rev "$rev" | tee ${ name } -src.json
26
- ''
36
+ cd ..
37
+
38
+ nix-prefetch-git https://${ repo } --rev "$rev" | tee ${ name } -src.json
39
+ ''
You can’t perform that action at this time.
0 commit comments