adoroszlai opened a new pull request, #3287:
URL: https://github.com/apache/ozone/pull/3287
## What changes were proposed in this pull request?
Install Hugo if necessary during build. Advantages:
* one fewer dependency to manually install
* improve stability by using fixed Hugo version, newer ones might break
compatibility
Reuse existing `docs.sh` (run in CI by _basic (docs)_ check) for this
purpose.
Allow skipping the execution of `docs.sh` via the new `skipDocs` property.
This is set by `build.sh`, so that other checks do not fail in case of doc
validation problems, which should be caught by the _basic (docs)_ check.
https://issues.apache.org/jira/browse/HDDS-6512
## How was this patch tested?
### Hugo available
```
$ rm -fr .dev-tools/hugo
$ which hugo
/usr/local/bin/hugo
$ mvn -am -pl :hdds-docs clean compile
...
[INFO] --- exec-maven-plugin:1.3.1:exec (default) @ hdds-docs ---
Skip installing hugo, as it's already available on PATH.
Start building sites …
| EN | ZH
-------------------+----+-----
Pages | 86 | 50
Paginator pages | 0 | 0
Non-page files | 26 | 26
Static files | 26 | 26
Processed images | 0 | 0
Aliases | 1 | 0
Sitemaps | 2 | 1
Cleaned | 0 | 0
...
[INFO] BUILD SUCCESS
```
### Force Ozone-specific tool
```
$ rm -fr .dev-tools/hugo
$ which hugo
/usr/local/bin/hugo
$ OZONE_PREFER_LOCAL_TOOL=false mvn -am -pl :hdds-docs clean compile
...
[INFO] --- exec-maven-plugin:1.3.1:exec (default) @ hdds-docs ---
Installed hugo in .dev-tools/hugo
Start building sites …
| EN | ZH
-------------------+----+-----
Pages | 86 | 50
Paginator pages | 0 | 0
Non-page files | 26 | 26
Static files | 26 | 26
Processed images | 0 | 0
Aliases | 1 | 0
Sitemaps | 2 | 1
Cleaned | 0 | 0
...
[INFO] BUILD SUCCESS
```
### Hugo not available
Verified that docs are built even if Hugo is not installed:
```
$ rm -fr .dev-tools/hugo
$ chmod 600 /usr/local/bin/hugo
$ which hugo
hugo not found
$ mvn -am -pl :hdds-docs clean compile
...
[INFO] --- exec-maven-plugin:1.3.1:exec (default) @ hdds-docs ---
Installed hugo in .dev-tools/hugo
Start building sites …
| EN | ZH
-------------------+----+-----
Pages | 86 | 50
Paginator pages | 0 | 0
Non-page files | 26 | 26
Static files | 26 | 26
Processed images | 0 | 0
Aliases | 1 | 0
Sitemaps | 2 | 1
Cleaned | 0 | 0
...
[INFO] BUILD SUCCESS
```
### Skipping docs build
Verified that Hugo is not installed or executed with `-DskipDocs`:
```
$ rm -fr .dev-tools/hugo
$ which hugo
hugo not found
$ mvn -DskipDocs -am -pl :hdds-docs clean compile
...
[INFO] --- exec-maven-plugin:1.3.1:exec (default) @ hdds-docs ---
[INFO] skipping execute as per configuraion
...
[INFO] BUILD SUCCESS
```
Regular CI:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]