Skip to content

Commit 7b37901

Browse files
jeantilArsnael
authored andcommitted
[JAMES-4175] upgrade jekyll version
Updates build documentation Creates dedicated nix devshell for jekyll in the homepage directory
1 parent 91490ec commit 7b37901

7 files changed

Lines changed: 553 additions & 45 deletions

File tree

docs/modules/community/pages/contributing.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ patch is more likely to be committed quickly.
194194

195195
There is work in progress to support a more reproductible dev environment so you don't have to figure out what to install or how.
196196

197-
If you already have the nix package manager installed you should be able to use the following command to enter the predefined build env :
197+
This work is based on nix flakes if you are not familiar with nix or flakes you can find more information in the https://nix.dev/manual/nix/2.28/command-ref/new-cli/nix3-flake.html[official documentation], https://wiki.nixos.org/wiki/Flakes[official wiki] or in https://zero-to-nix.com/concepts/flakes/[dedicated] community https://nix.dev/concepts/flakes[resources].
198+
199+
If you already have the nix package manager installed you should be able to use the following command to enter the predefined build env (experimental nix flag `flakes` is required, `nix-command` is recommended as it is used in many examples) with :
198200

199201
```
200202
nix develop --no-update-lock-file

docs/modules/community/pages/website.adoc

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,92 @@ https://james.staged.apache.org[staging version] of the website.
2222
====
2323

2424
== Building the homepage
25+
2526
You can use jekyll to build the website. Go into `{path}` and run the following command
2627

27-
[,shell]
28+
=== Docker
29+
30+
[WARNING]
31+
====
32+
The official docker image `jekyll/jekyll` is unmaintained and is not compatible with jekyll version beyond 4.2.2.
33+
In this documentation we suggest a replacement `jvconseil/jekyll-docker` but note that this is not an official image.
34+
Use at your own risks.
35+
====
36+
37+
[source,shell]
2838
----
29-
$ docker run --rm -v="$PWD:/srv/jekyll:Z" -it jekyll/jekyll:$JEKYLL_VERSION jekyll build
39+
$ docker run --rm -v="$PWD:/srv/jekyll:Z" -it jvconseil/jekyll-docker:4 jekyll build
3040
----
3141

3242
The resulting deployable content will be available in the `{path}/_site/`
3343
directory.
3444

3545
In order to test the homepage, you can use this command:
36-
[,shell]
46+
[source,shell]
3747
----
38-
$ docker run --rm -v $PWD/site:/srv/jekyll -p 4000:4000 -it jekyll/jekyll jekyll serve
48+
$ docker run --rm -v $PWD/site:/srv/jekyll -p 4000:4000 -it jvconseil/jekyll-docker:4 jekyll serve
3949
----
4050
The site will be available at http://localhost:4000/
4151

4252

4353
If you need to update the current site, checkout the branch asf-site from
4454
Apache git:
45-
[,shell]
55+
[source,shell]
4656
----
4757
$ git clone https://git-wip-us.apache.org/repos/asf/james-site.git
4858
$ cd james-site
4959
$ git checkout origin/asf-site -b asf-site
5060
----
5161

52-
And replace in the previous commands `$PWD/site` by
53-
`<james-site-clone-directory>/content`, for example:
62+
make sure to build the site then copy the output to
5463

55-
[,shell]
64+
[source,shell]
5665
----
57-
$ docker run -v $PWD:/origin -v $PWD/../james-site/content:/destination james/homepage master
58-
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD/../james-site/content:/origin -v $PWD/site:/destination james/site master
66+
$ docker run --rm -v="$PWD:/srv/jekyll:Z" -it jvconseil/jekyll-docker:4 jekyll build
67+
$ cp ../james-site/content
5968
----
6069

6170
Then just push the new site:
62-
[,shell]
71+
[source,shell]
6372
----
6473
$ cd ../james-site
6574
$ git push origin asf-site
6675
----
6776

77+
=== Experimental nix environment
78+
79+
From the root of the repository checkout, you can use the flake's devshell
80+
81+
[source,shell]
82+
----
83+
$ cd src/homepage
84+
$ nix develop
85+
----
86+
87+
Then use jekyll directly
88+
89+
[source,shell]
90+
----
91+
$ jekyll serve
92+
# or
93+
$ jekyll build
94+
----
95+
96+
==== Gemset update for nix
97+
98+
Updating the gemset to track the gemfile updates is a bit involved :
99+
100+
. ensure you are out of all nix devshell (check using `echo $SHLVL` it should be 1)
101+
. create a temporary shell for gem manipulation `nix-shell -p ruby -p bundix`
102+
. update the gemfile then run
103+
+
104+
[,shell]
105+
----
106+
BUNDLE_FORCE_RUBY_PLATFORM="true" bundle lock --update
107+
bundix -l
108+
----
109+
. exit the temporary shell and enter the devShell again `nix develop`
110+
68111
== Maven site
69112

70113
The maven site deploy phase uses and requires locally configuring credentials to
@@ -100,7 +143,7 @@ The docker file in `src/site-docker` is currently broken:
100143
prepare for some tinkering before building using this method.
101144
====
102145

103-
[,shell]
146+
[source,shell]
104147
----
105148
$ docker build -t james/site src/site-docker
106149
$ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/site:/destination james/site master
@@ -109,7 +152,7 @@ $ docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -v $PWD/site:/destination jam
109152
=== Nix development shell
110153

111154
Enter the xref:contributing.adoc#_experimental_nix_support[james experimental
112-
development shell]
155+
development shell] with `nix develop`.
113156

114157
1. run `mvn clean package site -Djib.skip`
115158
2. Test the built site in your browser from the `{path}/target/site` folder

docs/modules/community/partials/antora.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Go to `http://localhost` in your browser.
4848
=== Build with the nix enviroment
4949

5050
Enter the xref:contributing.adoc#_experimental_nix_support[james experimental
51-
development shell]
51+
development shell] with `nix develop`
5252

5353
. Build the Antora content locally
5454
+

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
packages = with pkgs; [
3030
antora # build documentation
3131
bundler # homepage and blog
32+
bundix
3233
cacert # ssl certificate management
3334
dive # explore generated docker images
3435
git # version control
3536
jdk # build and run james
36-
jekyll # homepage and blog
3737
maven # build james
3838
];
3939
MAVEN_OPTS = "-Djna.library.path=" + pkgs.lib.makeLibraryPath [pkgs.udev];

src/homepage/Gemfile.lock

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,94 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.8.1)
5-
public_suffix (>= 2.0.2, < 6.0)
4+
addressable (2.8.9)
5+
public_suffix (>= 2.0.2, < 8.0)
6+
base64 (0.3.0)
7+
bigdecimal (4.0.1)
68
colorator (1.1.0)
7-
concurrent-ruby (1.1.10)
9+
concurrent-ruby (1.3.6)
10+
csv (3.3.5)
811
em-websocket (0.5.3)
912
eventmachine (>= 0.12.9)
1013
http_parser.rb (~> 0)
1114
eventmachine (1.2.7)
12-
ffi (1.15.5)
15+
ffi (1.17.3)
16+
ffi (1.17.3-x86_64-linux-musl)
1317
forwardable-extended (2.6.0)
14-
http_parser.rb (0.8.0)
15-
i18n (1.12.0)
18+
google-protobuf (4.34.0)
19+
bigdecimal
20+
rake (~> 13.3)
21+
google-protobuf (4.34.0-x86_64-linux-musl)
22+
bigdecimal
23+
rake (~> 13.3)
24+
http_parser.rb (0.8.1)
25+
i18n (1.14.8)
1626
concurrent-ruby (~> 1.0)
17-
jekyll (4.2.2)
27+
jekyll (4.4.1)
1828
addressable (~> 2.4)
29+
base64 (~> 0.2)
1930
colorator (~> 1.0)
31+
csv (~> 3.0)
2032
em-websocket (~> 0.5)
2133
i18n (~> 1.0)
22-
jekyll-sass-converter (~> 2.0)
34+
jekyll-sass-converter (>= 2.0, < 4.0)
2335
jekyll-watch (~> 2.0)
24-
kramdown (~> 2.3)
36+
json (~> 2.6)
37+
kramdown (~> 2.3, >= 2.3.1)
2538
kramdown-parser-gfm (~> 1.0)
2639
liquid (~> 4.0)
27-
mercenary (~> 0.4.0)
40+
mercenary (~> 0.3, >= 0.3.6)
2841
pathutil (~> 0.9)
29-
rouge (~> 3.0)
42+
rouge (>= 3.0, < 5.0)
3043
safe_yaml (~> 1.0)
31-
terminal-table (~> 2.0)
44+
terminal-table (>= 1.8, < 4.0)
45+
webrick (~> 1.7)
3246
jekyll-feed (0.17.0)
3347
jekyll (>= 3.7, < 5.0)
34-
jekyll-sass-converter (2.2.0)
35-
sassc (> 2.0.1, < 3.0)
48+
jekyll-sass-converter (3.1.0)
49+
sass-embedded (~> 1.75)
3650
jekyll-seo-tag (2.8.0)
3751
jekyll (>= 3.8, < 5.0)
3852
jekyll-watch (2.2.1)
3953
listen (~> 3.0)
40-
kramdown (2.4.0)
41-
rexml
54+
json (2.18.1)
55+
kramdown (2.5.2)
56+
rexml (>= 3.4.4)
4257
kramdown-parser-gfm (1.1.0)
4358
kramdown (~> 2.0)
44-
liquid (4.0.3)
45-
listen (3.7.1)
59+
liquid (4.0.4)
60+
listen (3.10.0)
61+
logger
4662
rb-fsevent (~> 0.10, >= 0.10.3)
4763
rb-inotify (~> 0.9, >= 0.9.10)
64+
logger (1.7.0)
4865
mercenary (0.4.0)
49-
minima (2.5.1)
66+
minima (2.5.2)
5067
jekyll (>= 3.5, < 5.0)
5168
jekyll-feed (~> 0.9)
5269
jekyll-seo-tag (~> 2.1)
5370
pathutil (0.16.2)
5471
forwardable-extended (~> 2.6)
55-
public_suffix (5.0.0)
72+
public_suffix (7.0.2)
73+
rake (13.3.1)
5674
rb-fsevent (0.11.2)
57-
rb-inotify (0.10.1)
75+
rb-inotify (0.11.1)
5876
ffi (~> 1.0)
59-
rexml (3.2.5)
60-
rouge (3.30.0)
77+
rexml (3.4.4)
78+
rouge (4.7.0)
6179
safe_yaml (1.0.5)
62-
sassc (2.4.0)
63-
ffi (~> 1.9)
64-
terminal-table (2.0.0)
65-
unicode-display_width (~> 1.1, >= 1.1.1)
66-
unicode-display_width (1.8.0)
80+
sass-embedded (1.97.3)
81+
google-protobuf (~> 4.31)
82+
rake (>= 13)
83+
sass-embedded (1.97.3-x86_64-linux-musl)
84+
google-protobuf (~> 4.31)
85+
terminal-table (3.0.2)
86+
unicode-display_width (>= 1.1.1, < 3)
87+
unicode-display_width (2.6.0)
6788
webrick (1.9.2)
6889

6990
PLATFORMS
91+
ruby
7092
x86_64-linux-musl
7193

7294
DEPENDENCIES
@@ -75,7 +97,7 @@ DEPENDENCIES
7597
webrick
7698

7799
RUBY VERSION
78-
ruby 3.1.1p18
100+
ruby 3.3.10p183
79101

80102
BUNDLED WITH
81103
2.3.25

src/homepage/flake.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
description = "james homepage build env";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
6+
};
7+
8+
outputs =
9+
{ self, nixpkgs }@inputs:
10+
let
11+
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
12+
in
13+
{
14+
devShell = forAllSystems (
15+
system:
16+
let
17+
pkgs = import nixpkgs { inherit system; };
18+
env = pkgs.bundlerEnv {
19+
name = "james homepagebuild env";
20+
gemdir = ./.;
21+
groups = [
22+
"default"
23+
"development"
24+
"test"
25+
];
26+
27+
meta = with pkgs.lib; {
28+
description = "james homepagebuild env";
29+
platforms = platforms.unix;
30+
};
31+
};
32+
in
33+
pkgs.mkShell {
34+
buildInputs = [
35+
env
36+
env.wrappedRuby
37+
pkgs.bundix
38+
];
39+
}
40+
);
41+
};
42+
}

0 commit comments

Comments
 (0)