Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ocaml-dune/binary-distribution
A web page for dune binary distribution
https://github.com/ocaml-dune/binary-distribution
build dune ocaml
Last synced: 3 months ago
JSON representation
A web page for dune binary distribution
- Host: GitHub
- URL: https://github.com/ocaml-dune/binary-distribution
- Owner: ocaml-dune
- License: isc
- Created: 2024-04-19T09:58:05.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T16:23:59.000Z (3 months ago)
- Last Synced: 2024-10-16T19:39:46.534Z (3 months ago)
- Topics: build, dune, ocaml
- Language: HTML
- Homepage: https://preview.dune.build/
- Size: 6.02 MB
- Stars: 2
- Watchers: 2
- Forks: 5
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Dune binaries distribution
This is a webpage for `dune` binaries distribution of `Dune developer Preview`.
The page is automatically generated from file `metadata.json`. Apart from the
_YAML_ part, the code is written in _OCaml_.The GitHub Actions pipeline regularly creates commit on the `main` branch where
it:
- updates the content of `metadata.json`
- generates new artifacts and pushes them to their SSH storage using `RClone`
- publishes the Dockerfile used to deploy the websiteThe web page is deployed on [preview.dune.build](https://preview.dune.build).
> :hourglass: The pipeline is triggered every day at _01:00 UTC_.
> [!CAUTION]
> The _metadata.json_ file must not be modified manually. If you do so, expect some unexpected behaviours.## Installation & configuration
### Requirement
You need to have `opam` available to install and build the project.
### Install
The _OCaml code_ is stored in the repository root directory. Install
the dependencies with the following commands:```sh
$ opam install . --deps-only --with-dev-setup
```Please note that `--with-dev-setup` should only be used for a development
purpose.### Configure
The configuration is in [bin/config.ml](./bin/config.ml)
file. When running in the pipeline, the _sandworm_ binary is generated before
its execution. As a result, the path taken is the root of this repository. If
you want to run it locally, make sure the _files artifacts_ and `rclone.conf`
are available in the directory where _sandworm_ binary is executed.The export relies on an SSH key to the server. If you want to run your own
tests, you need to have a server available by _SSH_ with an _SSH key_. Then,
you have to create a `rclone.conf` file as follows:```toml
[dune-binary-distribution]
type = sftp
user =
host =
key_file =
shell_type = unix
```If you don't have a `/dune` directory on your server, you might want to change
the `s3_bucket_ref` variable. It could be:```ocaml
let s3_bucket_ref = "dune-binary-distribution:/path/to/your/server/dir"
```> [!TIP]
> For our use case, the _RClone_ configuration works with SFTP but, it is
> compatible with any _RClone_ provider.## Running
Now your setup is ready, you can execute this list of commands to generate or
update the files:```sh
$ ls
artifacts rclone.conf
$ dune exec -- sandworm sync --commit [commit hash]
```## Running the developement server
To make the development of the web pages easier, you can use the web server in
developement mode. It will auto update the page will saving files and,
regenarate the CSS if needed:```sh
$ dune exec --watch sandworm -- serve --dev
```You can then go to [http://localhost:8080/](http://localhost:8080) and see the
website.The flag `--dev` has two actions. To protect the users, it only exposes the
server to `localhost` instead of `0.0.0.0`. Also, it injects a script in the
page to ensure the page is reloaded when you restart the server.## Deploying
The deployment are automatically done through GitHub Actions. No need to add
extra work to deploy it.## Understand the pipeline
This schema provides explanations about the workflow used to build the binaries
and the certificates, and export them to the correct server.
![pipeline](./docs/pipeline.svg)