-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path.travis-opam.sh
37 lines (27 loc) · 1 KB
/
.travis-opam.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
( set +x; echo -en "travis_fold:start:prepare.ci\r"; ) 2>/dev/null
# If a fork of these scripts is specified, use that GitHub user instead
fork_user=${FORK_USER:-ocaml}
# If a branch of these scripts is specified, use that branch instead of 'master'
fork_branch=${FORK_BRANCH:-master}
### Bootstrap
set -uex
get() {
wget https://raw.githubusercontent.com/${fork_user}/ocaml-ci-scripts/${fork_branch}/$@
}
test "$TRAVIS_REPO_SLUG" = "ocaml/ocaml-ci-scripts" || \
get .travis-ocaml.sh
sh .travis-ocaml.sh
source .travis-ocaml.env
export OPAMYES=1
eval $(opam config env)
opam depext -y conf-m4
if [ "$TRAVIS_REPO_SLUG" = "ocaml/ocaml-ci-scripts" ] ; then
opam pin add travis-opam --kind=path .
else
opam pin add travis-opam https://github.com/${fork_user}/ocaml-ci-scripts.git#${fork_branch}
fi
cp ~/.opam/$(opam switch show)/bin/ci-opam ~/
opam remove -a travis-opam
mv ~/ci-opam ~/.opam/$(opam switch show)/bin/ci-opam
( set +x; echo -en "travis_fold:end:prepare.ci\r" ) 2>/dev/null
opam config exec -- ci-opam