aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-06-17 23:17:06 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-06-19 01:11:43 +0200
commit127840e0a237e332b1f4ab88eb63a28f810b9b6b (patch)
treecca556fb3ed9033782c8c32a8692ad43f8ef8485 /scripts
parent2e8e3d076647f8426d08cfacb283b43fa0e7ffb1 (diff)
ci: Move stack resolver table to a file
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/update-stack-resolvers.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/ci/update-stack-resolvers.sh b/scripts/ci/update-stack-resolvers.sh
new file mode 100755
index 0000000..d0dacd1
--- /dev/null
+++ b/scripts/ci/update-stack-resolvers.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Example:
+# $ scripts/ci/update-stack-resolvers.sh | tee tests/stack-resolvers
+
+mkdir -p /tmp/stack-resolvers/
+
+wget -q https://s3.amazonaws.com/haddock.stackage.org/snapshots.json \
+ -O /tmp/stack-resolvers/snapshots.json
+
+resolvers=$(cat /tmp/stack-resolvers/snapshots.json \
+ | jq -r '.[]' | grep ^lts- | sort -V -r | uniq)
+
+for res in $resolvers; do
+ wget -q --continue \
+ -O /tmp/stack-resolvers/$res.yaml \
+ https://raw.githubusercontent.com/fpco/lts-haskell/master/$res.yaml
+
+ ghc=$(cat /tmp/stack-resolvers/$res.yaml \
+ | grep ghc-version | awk '{ print $2 }' | tr -cd '0-9.')
+
+ printf '%-10s %s\n' "$ghc" "$res"
+done