File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 5
5
with stdenv . lib ;
6
6
7
7
let
8
- repo = "github.com/input-output-hk/${ name } .nix.git" ;
9
- tokenFile = "/run/keys/buildkite-nix-tools-token " ;
10
- githubUser = "iohk-devops " ;
8
+ repoHTTPS = "https:// github.com/input-output-hk/${ name } .nix.git" ;
9
+ repoSSH = "[email protected] :input-output-hk/${ name } .nix.git " ;
10
+ sshKey = "/run/keys/buildkite- ${ name } -ssh-private " ;
11
11
in
12
12
writeScript "update-${ name } -nix.sh" ''
13
13
#!${ stdenv . shell }
23
23
24
24
rev=$(git rev-parse HEAD)
25
25
26
- if [ -f ${ tokenFile } ];
27
- echo "Authenticating as ${ githubUser } "
28
- auth=" ${ githubUser } :$(head -n1 ${ tokenFile } )@ "
26
+ if [ -e ${ sshKey } ];
27
+ echo "Authenticating using SSH with ${ sshKey } "
28
+ export GIT_SSH_COMMAND="ssh -i ${ sshKey } -F /dev/null "
29
29
else
30
- echo "There is no GitHub token in ${ tokenFile } "
31
- auth=" "
30
+ echo "There is no SSH key at ${ sshKey } "
31
+ echo "Git push may not work. "
32
32
fi
33
33
34
- git push "https:// '' ${auth} ${ repo } "
34
+ git push ${ repoSSH }
35
35
36
36
cd ..
37
37
38
- nix-prefetch-git https:// ${ repo } --rev "$rev" | tee ${ name } -src.json
38
+ nix-prefetch-git ${ repoHTTPS } --rev "$rev" | tee ${ name } -src.json
39
39
''
You can’t perform that action at this time.
0 commit comments