git.iko.soy/typeable/pagerduty
on develop help sign in
Adding stack/travis configuration
commit63bc60c8b744ada694451d4004a87d35265efd61 authorBrendan Hay <brendan.g.hay@gmail.com> dateSun 25 Oct 2015, 11:34 (11 years ago) parenta323c7b
7 files changed+83−66
.travis.yml+30−4 script/generate-pages−25 script/travis-lifecycle-before_install+16 script/travis-lifecycle-install+13 script/travis-lifecycle-script+9 script/travis-timeout+15 script/upload-documentation−37
.travis.yml+30−4
@@ -1,4 +1,30 @@
1−language: haskell
2−ghc: 7.8.4
3−install: []
4−script: [make all]
1+sudo: false
2+
3+cache:
4+ apt: true
5+ directories:
6+ - ~/.stack
7+
8+branches:
9+ only:
10+ - master
11+ - develop
12+
13+before_install:
14+ - export PATH=/opt/ghc/$GHCVER/bin:$PATH
15+ - export PATH=~/.local/bin:$PATH
16+ - ./script/travis-lifecycle-before_install
17+
18+install:
19+ - ./script/travis-lifecycle-install
20+
21+script:
22+ - ./script/travis-lifecycle-script
23+
24+matrix:
25+ fast_finish: true
26+ include:
27+ - env: GHCVER=7.10.2
28+ addons: { apt: { packages: [ghc-7.10.2], sources: [hvr-ghc] } }
29+ - env: GHCVER=7.8.4
30+ addons: { apt: { packages: [ghc-7.8.4], sources: [hvr-ghc] } }
script/generate-pagesdeleted−25
@@ -1,25 +0,0 @@
1−#!/usr/bin/env bash
2−
3−set -e
4−set -x
5−set -o errexit
6−
7−branch=$(git symbolic-ref -q HEAD)
8−branch=${branch##refs/heads/}
9−branch=${branch:-HEAD}
10−
11−cabal configure --disable-tests
12−
13−DOCDIR=`mktemp -d -t pages.XXXXXX`
14−cabal haddock --haddock-option=-o$DOCDIR
15−
16−HEAD=`git rev-parse HEAD`
17−
18−git checkout gh-pages
19−
20−mv $DOCDIR/* .
21−
22−git add *.html *.js *.css *.gif *.png
23−git commit -m "Generated documentation from $HEAD on $branch"
24−git push origin gh-pages
25−git checkout $branch
script/travis-lifecycle-before_installnew file+16
@@ -0,0 +1,16 @@
1+#!/usr/bin/env bash
2+
3+set -e
4+
5+dir=~/.local/bin
6+remote=https://github.com/commercialhaskell/stack/releases/download/v0.1.3.1/stack-0.1.3.1-x86_64-linux.gz
7+local=$dir/stack
8+
9+mkdir -p $dir
10+
11+curl -L $remote | gunzip > $local
12+
13+chmod a+x $local
14+
15+ghc --version
16+stack --version
script/travis-lifecycle-installnew file+13
@@ -0,0 +1,13 @@
1+#!/usr/bin/env bash
2+
3+set -e
4+
5+GHCVER=${GHCVER?"GHCVER needs to be set."}
6+
7+path=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
8+
9+$path/travis-timeout \
10+ stack --no-terminal --skip-ghc-check --stack-yaml stack-$GHCVER.yaml setup
11+
12+$path/travis-timeout \
13+ stack --no-terminal --skip-ghc-check --stack-yaml stack-$GHCVER.yaml test pagerduty --only-snapshot
script/travis-lifecycle-scriptnew file+9
@@ -0,0 +1,9 @@
1+#!/usr/bin/env bash
2+
3+set -e
4+
5+GHCVER=${GHCVER?"GHCVER needs to be set."}
6+
7+path=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
8+
9+stack --no-terminal --skip-ghc-check --stack-yaml stack-$GHCVER.yaml test pagerduty
script/travis-timeoutnew file+15
@@ -0,0 +1,15 @@
1+#!/usr/bin/env bash
2+
3+$* &
4+pidA=$!
5+minutes=0
6+
7+while true; do sleep 60; ((minutes++)); echo -e "\033[0;32m$minutes minute(s) elapsed running '$*'\033[0m."; done &
8+pidB=$!
9+wait $pidA
10+resA=$?
11+
12+echo -e "\033[0;32m'$*' exited with status ${resA}.\033[0m"
13+kill -9 $pidB
14+
15+exit $resA
script/upload-documentationdeleted−37
@@ -1,37 +0,0 @@
1−#!/usr/bin/env bash
2−
3−set -e
4−
5−package=${PWD##*/}
6−
7−echo "Package: ${package}"
8−read -p "Version: " version
9−read -p "Hackage user: " user
10−read -sp "Hackage password (not echoed): " password
11−
12−echo
13−echo "BUILDING"
14−echo
15−
16−cabal configure
17−cabal build
18−cabal haddock \
19− --hyperlink-source \
20− --html-location='/package/$pkg-$version/docs' \
21− --contents-location='/package/$pkg'
22−
23−echo
24−echo "ARCHIVING"
25−echo
26−
27−cd dist/doc/html
28−DDIR="${package}-${version}-docs"
29−cp -r "${package}" "${DDIR}" && gtar -c -v -z -Hustar -f "${DDIR}.tar.gz" "${DDIR}"
30−
31−echo
32−echo "UPLOADING"
33−echo
34−
35−curl -X PUT -H 'Content-Type: application/x-tar' \
36− -H 'Content-Encoding: gzip' --data-binary "@${DDIR}.tar.gz" \
37− "http://${user}:${password}@hackage.haskell.org/package/${package}-${version}/docs"