forked from input-output-hk/haskell.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nightly: Also update hackage-src.json and stackage-src.json
- Loading branch information
Showing
5 changed files
with
72 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Env variables and functions for updating git repos | ||
|
||
export GIT_COMMITTER_NAME="IOHK" | ||
export GIT_COMMITTER_EMAIL="[email protected]" | ||
export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME" | ||
export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL" | ||
|
||
use_ssh_key() { | ||
sshkey=$1 | ||
if [ -e $sshkey ] | ||
then | ||
echo "Authenticating using SSH with $sshkey" | ||
export GIT_SSH_COMMAND="ssh -i $sshkey -F /dev/null" | ||
else | ||
echo "There is no SSH key at $sshkey" | ||
echo "Git push may not work." | ||
fi | ||
} | ||
|
||
check_staged() { | ||
if git diff-index --cached --quiet HEAD --; then | ||
echo "No changes to commit, exiting." | ||
exit 0 | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,27 +19,19 @@ in | |
${script} | ||
source ${./git.env} | ||
echo "Committing changes..." | ||
export GIT_COMMITTER_NAME="IOHK" | ||
export GIT_COMMITTER_EMAIL="[email protected]" | ||
export GIT_AUTHOR_NAME="$GIT_COMMITTER_NAME" | ||
export GIT_AUTHOR_EMAIL="$GIT_COMMITTER_EMAIL" | ||
git add . | ||
git commit --allow-empty --message "Automatic update for $(date)" | ||
rev=$(git rev-parse HEAD) | ||
check_staged | ||
git commit --message "Automatic update for $(date)" | ||
if [ -e ${sshKey} ] | ||
then | ||
echo "Authenticating using SSH with ${sshKey}" | ||
export GIT_SSH_COMMAND="ssh -i ${sshKey} -F /dev/null" | ||
else | ||
echo "There is no SSH key at ${sshKey}" | ||
echo "Git push may not work." | ||
fi | ||
use_ssh_key ${sshKey} | ||
git push ${repoSSH} | ||
rev=$(git rev-parse HEAD) | ||
cd .. | ||
nix-prefetch-git ${repoHTTPS} --rev "$rev" | tee ${name}-src.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ stdenv, writeScript, coreutils, glibc, git, openssh }@args: | ||
|
||
with stdenv.lib; | ||
|
||
let | ||
repo = "[email protected]:input-output-hk/haskell.nix.git"; | ||
sshKey = "/run/keys/buildkite-haskell-nix-ssh-private"; | ||
in | ||
writeScript "update-pins.sh" '' | ||
#!${stdenv.shell} | ||
set -euo pipefail | ||
export PATH="${makeBinPath [ coreutils glibc git openssh ]}" | ||
source ${./git.env} | ||
git add *.json | ||
check_staged | ||
echo "Committing changes..." | ||
git commit --message "Update Hackage and Stackage" | ||
use_ssh_key ${sshKey} | ||
git push ${repo} | ||
'' |