on develop help sign in
Adding scripts to generate stack and travis configurations
commit90aebe0f1f78a40c1f7645b4e8d975c587d28b26 authorBrendan Hay <brendan.g.hay@gmail.com> dateSat 11 Feb 2017, 08:36 (10 years ago) parent5ce03fd
4 files changed+40−16
script/generate+6 script/generate-stack-config+18 script/travis-matrix → script/generate-travis-config+16−6 script/stack-packages−10
script/generatenew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/env bash
2+
3+set -euo pipefail
4+
5+./script/generate-travis-config
6+./script/generate-stack-config
script/generate-stack-confignew file+18
@@ -0,0 +1,18 @@
1+#!/usr/bin/env bash
2+
3+set -euo pipefail
4+
5+library=( $(ls -d gogol-*) )
6+library=( $(echo ${library[@]} | tr ' ' '\n' | sort | uniq -u) )
7+
8+for config in stack-*.yaml; do
9+ echo "Updating ${config}"
10+
11+ sed -i -e '/# GENERATED/,/# END GENERATED/d' "${config}"
12+
13+ echo "# GENERATED" >> "${config}"
14+ echo "$(printf ' - %s\n' "${library[@]}")" >> "${config}"
15+ echo "# END GENERATED" >> "${config}"
16+done
17+
18+echo "Done."
script/travis-matrix → script/generate-travis-configrenamed+16−6
@@ -1,6 +1,6 @@
11#!/usr/bin/env bash
22
3−set -e
3+set -euo pipefile
44
55docs=( documentation )
66core=( gogol-core gogol )
@@ -43,8 +43,18 @@ ghc_710=( 7.10.3 )
4343ghc_801=( 8.0.1 )
4444ghc_all=( 8.0.1 7.10.3 )
4545
46−matrix "Documentation" ghc_710[@] docs[@]
47−matrix "Core" ghc_all[@] core[@]
48−matrix "Priority" ghc_801[@] priority[@]
49−matrix "Remainder" ghc_801[@] library[@]
50−matrix "Examples" ghc_801[@] examples[@]
46+travis=".travis.yml"
47+
48+echo "Updating ${travis}"
49+
50+sed -i -e '/# GENERATED/,/# END GENERATED/d' "${travis}"
51+
52+echo "# GENERATED" >> "${travis}"
53+matrix "Documentation" ghc_710[@] docs[@] >> "${travis}"
54+matrix "Core" ghc_all[@] core[@] >> "${travis}"
55+matrix "Priority" ghc_all[@] priority[@] >> "${travis}"
56+matrix "Remainder" ghc_801[@] library[@] >> "${travis}"
57+matrix "Examples" ghc_801[@] examples[@] >> "${travis}"
58+echo "# END GENERATED" >> "${travis}"
59+
60+echo "Done."
script/stack-packagesdeleted−10
@@ -1,10 +0,0 @@
1−#!/usr/bin/env bash
2−
3−library_=( $(ls -d gogol-*) )
4−library=( $(echo ${library_[@]} | tr ' ' '\n' | sort | uniq -u) )
5−
6−for lib in ${library[@]}; do
7−cat <<-LIB
8− - $lib
9−LIB
10−done