You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: HACKING.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ Before starting to hack, you need a properly configured development environment.
13
13
14
14
The project [`Dockerfile`](./Dockerfile) contains up-to-date system configuration instructions, as used to ship into production. It is written for the Alpine Linux distribution, but it is meant to be adapted to other environments such as Ubuntu, macOS+Homebrew, or others. The GitHub workflow file [`.github/workflows/ci.yml`](.github/workflows/ci.yml) also contains useful commands for Ubuntu and macOS. Since OCaml.org is mostly written in OCaml, a properly configured OCaml development environment is also required, but is not detailed here. Although Docker is used to ship, it is not a requirement to begin hacking. Currently, OCaml.org doesn't yet compile using OCaml 5; version 4.14 of the language is used. It is possible to run workflow files in `.github/workflows` using the [`nektos/act`](https://github.com/nektos/act) tool. For instance, the following command runs the CI checks through GitHub on each pull request (where `ghghgh` is replace by an _ad-hoc_ GitHub token, see: <https://github.com/nektos/act#github_token>)
@@ -30,13 +30,13 @@ With opam installed, you can now initialise opam with `opam init`. Note that in
30
30
31
31
Finally from the root of your project, you can setup a [local opam switch](https://opam.OCaml.org/doc/Manual.html#Switches) and install the dependencies. There is a single `make` target to do just that.
32
32
33
-
```
33
+
```bash
34
34
make switch
35
35
```
36
36
37
37
If you don't want a local opam switch and are happy to install everything globally (in the opam sense), then you can just install the dependencies directly.
38
38
39
-
```
39
+
```bash
40
40
make deps
41
41
```
42
42
@@ -82,13 +82,13 @@ You can build the playground from the root of the project. There is no need to m
82
82
83
83
To regenerate the playground, you need to install the playground's dependencies first:
84
84
85
-
```
85
+
```bash
86
86
make deps -C playground
87
87
```
88
88
89
89
After the dependencies have been installed, simply build the project to regenerate the JavaScript assets:
90
90
91
-
```
91
+
```bash
92
92
make playground
93
93
```
94
94
@@ -97,14 +97,15 @@ Once the compilation is complete and successuful, commit the newly-generated ass
97
97
### Deploying
98
98
99
99
Commits added on some branches are automatically deployed:
100
+
100
101
*`main` on <https://OCaml.org/>
101
102
*`staging` on <https://staging.OCaml.org/>
102
103
103
104
The deployment pipeline is managed in <https://github.com/ocurrent/ocurrent-deployer>, which listens to the `main` and `staging` branches and builds the site using the `Dockerfile` at the project's root. You can monitor the state of each deployment on [`deploy.ci.OCaml.org`](https://deploy.ci.OCaml.org/?repo=ocaml/OCaml.org).
104
105
105
106
To test the deployment locally, run the following commands:
106
107
107
-
```
108
+
```bash
108
109
docker build -t ocamlorg .
109
110
docker run -p 8080:8080 ocamlorg
110
111
```
@@ -129,7 +130,7 @@ before they get merged.
129
130
130
131
OCaml.org is using an opam switch that is local and bound to a pinned commit in `opam-repository`. This is intended to protect the build from upstream regressions. The opam repository is specified in three (3) places:
0 commit comments