This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch doc-about-docker
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 2baabc348196af5eb0f8c763260dc0916de2b2d7
Author: Nicolas Filotto <[email protected]>
AuthorDate: Wed Apr 13 18:05:52 2022 +0200

    Promote the usage of yarn in docker
---
 README.md          | 12 ++++++++++++
 yarn-in-docker.env |  4 ++++
 yarn-in-docker.sh  |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 28b59ff2..aaef3720 100644
--- a/README.md
+++ b/README.md
@@ -373,6 +373,18 @@ This is most likely what you want.
 If you need to link to a specific non-latest version of a page, specify the 
version in the xref.
 - A link from anywhere to a camel-quarkus 2.0.0 page would be 
xref:2.0.0@camel-quarkus::reference/extensions/activemq.adoc[].
 
+## Build with Yarn in Docker
+
+To avoid having to install everything on your local machine, you still have 
the possibility to launch the `yarn` commands directly inside a docker 
container in which all the required tools have been preinstalled.
+
+All you need to do is to call the script `yarn-in-docker.sh` with the 
arguments that you would like to pass to the `yarn` command.
+
+For `build-all`, the command to launch is then:
+
+    $ ./yarn-in-docker.sh build-all
+
+Note that this script actually launches Docker commands behind the scenes. In 
particular, it runs the container using `yarn-in-docker.env` as file of 
environment variables thus you will need to edit this file to provide the value 
of the environment variables to set inside the container.
+
 ## Build with Maven
 
 The project provides a simple way to build the website sources locally using 
the build tool [Maven](https://maven.apache.org/).
diff --git a/yarn-in-docker.env b/yarn-in-docker.env
new file mode 100644
index 00000000..5a2786c6
--- /dev/null
+++ b/yarn-in-docker.env
@@ -0,0 +1,4 @@
+#HUGO_PARAMS_GitHubUsername=<GitHub username>
+#HUGO_PARAMS_GitHubToken=<GitHub token>
+#GITHUB_TOKEN=<personal access token>
+#CAMEL_ENV=<production or netlify>
diff --git a/yarn-in-docker.sh b/yarn-in-docker.sh
index 55cf688d..63b5e164 100755
--- a/yarn-in-docker.sh
+++ b/yarn-in-docker.sh
@@ -5,4 +5,4 @@
 # $yarn-in-docker.sh workspace antora-ui-camel run build
 
 docker build -t camel-website .
-docker run --rm -it -v $(pwd):/work:Z --workdir /work camel-website yarn $*
+docker run --rm -it --env-file yarn-in-docker.env -v $(pwd):/work:Z --workdir 
/work camel-website yarn $*

Reply via email to