Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the CI script docker friendly #96

Merged
merged 2 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ module Op = struct
%a@.\
git fetch origin master@.\
git merge %s@.\
cat > Dockerfile <<'END-OF-DOCKERFILE'@.\
cat > ../Dockerfile <<'END-OF-DOCKERFILE'@.\
\o033[34m%a\o033[0m@.\
END-OF-DOCKERFILE@.\
docker build .@.@."
docker build -f ../Dockerfile .@.@."
Current_git.Commit_id.pp_user_clone commit
master
Dockerfile.pp (Obuilder_spec.Docker.dockerfile_of_spec ~buildkit:false (build_spec ~for_docker:true)));
Expand Down
28 changes: 14 additions & 14 deletions lib/opam_build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ let opam_install ~variant ~upgrade_opam ~pin ~with_tests ~pkg =
run ~network "opam %s" (if upgrade_opam then "update --depexts" else "depext -yu");
(* TODO: Replace by two calls to opam install + opam install -t using the OPAMDROPINSTALLEDPACKAGES feature *)
run ~cache ~network {|
opam remove -y %s && opam %s%s %s
res=$?
test "$res" = 0 && exit 0
opam remove -y %s && opam %s%s %s;
res=$?;
test "$res" = 0 && exit 0;
if test "$res" = 60 && diff -q /usr/bin/opam /usr/bin/opam-2.0; then
sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && opam init --reinit -ni
opam remove -y %s && opam install -vy%s %s%s
exit 1
fi
test "$res" != 31 && exit 1
export OPAMCLI=2.0
build_dir=$(opam var prefix)/.opam-switch/build
failed=$(ls "$build_dir")
sudo ln -f /usr/bin/opam-2.1 /usr/bin/opam && opam init --reinit -ni;
opam remove -y %s && opam install -vy%s %s%s;
exit 1;
fi;
test "$res" != 31 && exit 1;
export OPAMCLI=2.0;
build_dir=$(opam var prefix)/.opam-switch/build;
failed=$(ls "$build_dir");
for pkg in $failed; do
if opam show -f x-ci-accept-failures: "$pkg" | grep -qF "\"%s\""; then
echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field."
fi
done
echo "A package failed and has been disabled for CI using the 'x-ci-accept-failures' field.";
fi;
done;
exit 1|}
pkg (if upgrade_opam then "install -vy" else "depext -ivy") (if with_tests then "t" else "") pkg
pkg (if with_tests then "t" else "") pkg (if with_tests then "" else " && opam reinstall -vyt "^pkg)
Expand Down