Search code examples
continuous-integrationocamlopam

Unattended install of opam package manager


What's the usual way to install the latest version of OPAM (the OCaml package manager) in a CI environment (e.g. Travis CI)? The official install.sh shell script prompts for user input and doesn't have any command line options or environment variables to override that. I could use echo or cat to pipe some replies to standard input but that seems quite brittle.

I could also install OPAM from the OS package manager (e.g. apt on Linux) but it's often not the latest version.


Solution

  • The usual way is to use the scripts in ocaml-ci-scripts. The travis integration is documented here.