You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2022/03/28 17:46:00 UTC

[libcloud-site] 04/04: Add wrapper scripts for building the website using docker.

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

tomaz pushed a commit to branch asf-staging
in repository https://gitbox.apache.org/repos/asf/libcloud-site.git

commit c2c588ec6aedf5b5cde0ec4becc477904e27d8c5
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Mon Mar 28 00:51:27 2022 +0200

    Add wrapper scripts for building the website using docker.
---
 scripts/build-site.sh            | 24 ++++++++++++++++++++++++
 scripts/docker-build-site.sh     | 25 +++++++++++++++++++++++++
 scripts/docker-run-dev-server.sh | 21 +++++++++++++++++++++
 scripts/generate_site.sh         | 10 ----------
 scripts/run-dev-server.sh        | 15 +++++++++++++++
 5 files changed, 85 insertions(+), 10 deletions(-)

diff --git a/scripts/build-site.sh b/scripts/build-site.sh
new file mode 100755
index 0000000..524c8dc
--- /dev/null
+++ b/scripts/build-site.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cd source
+bundle exec jekyll build
+
+cd ..
+rsync -vurt --delete --exclude=".git/" --exclude="*.log" source/_site/* output/
+rm -rf source/_site
+cp source/.htaccess output/.htaccess
diff --git a/scripts/docker-build-site.sh b/scripts/docker-build-site.sh
new file mode 100755
index 0000000..c200b45
--- /dev/null
+++ b/scripts/docker-build-site.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+IMAGE_NAME="libcloud-site-dev"
+
+docker build --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" -f Dockerfile -t "${IMAGE_NAME}" . --progress=plain
+docker run --rm -v "$(pwd)":/home/jekyll/site -it "${IMAGE_NAME}" bash -c -l 'cd source; bundle exec jekyll build'
+
+rsync -vurt --delete --exclude=".git/" --exclude="*.log" source/_site/* output/
+rm -rf source/_site
+cp source/.htaccess output/.htaccess
diff --git a/scripts/docker-run-dev-server.sh b/scripts/docker-run-dev-server.sh
new file mode 100755
index 0000000..91066b8
--- /dev/null
+++ b/scripts/docker-run-dev-server.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+IMAGE_NAME="libcloud-site-dev"
+
+docker build --build-arg UID="$(id -u)" --build-arg GID="$(id -g)" -f Dockerfile -t "${IMAGE_NAME}" . --progress=plain
+docker run -p 4000:4000 --rm -v "$(pwd)":/home/jekyll/site -it "${IMAGE_NAME}" bash -c -l 'cd source ; bundle exec jekyll serve --watch --drafts --trace --force_polling -H 0.0.0.0 -P 4000'
diff --git a/scripts/generate_site.sh b/scripts/generate_site.sh
deleted file mode 100755
index 0cfa326..0000000
--- a/scripts/generate_site.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-cd source
-bundle exec jekyll build
-
-cd ..
-rsync -vurt --delete --exclude=".git/" --exclude="*.log" source/_site/* output/
-rm -rf source/_site
-rm -rf _site
-cp source/.htaccess output/.htaccess
diff --git a/scripts/run-dev-server.sh b/scripts/run-dev-server.sh
index 5c55054..cdd3f51 100755
--- a/scripts/run-dev-server.sh
+++ b/scripts/run-dev-server.sh
@@ -1,4 +1,19 @@
 #!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
 cd source
 bundle exec jekyll serve --watch --drafts --trace