This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-site.git
The following commit(s) were added to refs/heads/main by this push:
new 19b5c4e add Makefile and local setup instruction in README (#86)
19b5c4e is described below
commit 19b5c4ec5cf256c0e2688ec7cd397682bb93606a
Author: Kevin Liu <[email protected]>
AuthorDate: Wed Jul 9 04:17:54 2025 -0700
add Makefile and local setup instruction in README (#86)
* add makefile and edit readme
* docker -> local
* workaround: pin to specific commit for nfrastructure-actions
* Add docs and a `all` target
---------
Co-authored-by: Andrew Lamb <[email protected]>
---
Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
README.md | 24 ++++++------------------
2 files changed, 55 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b215c2f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,49 @@
+# 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 = df-site-build
+REPO_NAME = infrastructure-actions
+COMMIT_HASH = 8aee7a080268198548d8d1b4f1315a4fb94bffea
+
+.PHONY: clone build-image build
+
+all: build
+
+# clones the infrastructure-actions repository at a specific commit
+clone:
+ @if [ ! -d "$(REPO_NAME)" ]; then \
+ echo "Cloning $(REPO_NAME) at specific commit
$(COMMIT_HASH)..."; \
+ git clone --depth 1
https://github.com/apache/infrastructure-actions.git $(REPO_NAME); \
+ cd $(REPO_NAME) && git fetch --depth 1 origin $(COMMIT_HASH) &&
git checkout $(COMMIT_HASH); \
+ else \
+ echo "$(REPO_NAME) already exists, skipping clone."; \
+ fi
+ # Pinned to commit $(COMMIT_HASH) due to
https://github.com/apache/infrastructure-actions/issues/218
+
+# builds the Docker image with pelicanasf installed
+build-image:
+ @if ! docker image inspect $(IMAGE_NAME) > /dev/null 2>&1; then \
+ echo "Building Docker image $(IMAGE_NAME)..."; \
+ docker build -t $(IMAGE_NAME) $(REPO_NAME)/pelican; \
+ else \
+ echo "Docker image $(IMAGE_NAME) already exists, skipping
build."; \
+ fi
+
+# runs the Docker container to build the site
+build: clone build-image
+ docker run -it --rm -p8000:8000 -v $(PWD):/site --entrypoint /bin/bash
$(IMAGE_NAME) -c \
+ "pelicanasf content -o blog && python3 -m http.server 8000"
diff --git a/README.md b/README.md
index 48b11c8..395d47b 100644
--- a/README.md
+++ b/README.md
@@ -16,8 +16,7 @@ There are a couple of important impacts on the publishing:
There are two ways to preview your blog post before publishing the site. You
can
either locally build and test the site or you can use the auto staging feature
-of the CI system. To locally build the site on your machine, follow the docker
-instructions below.
+of the CI system. To locally build the site on your machine, follow the
instructions below.
To use the staging feature of the CI system, push a branch that starts with
`site/` and create a PR to merge this branch into `main`. When you do so, it
@@ -25,31 +24,20 @@ will trigger a CI process that will build the site and push
it to the branch
`asf-staging`. Once this completes, the ASF infrastructure will auto publish
this staged branch to https://datafusion.staged.apache.org/ It is important
to note that this staging feature only works for branches on the main repo.
-If you are working on a forked repo, you will need to use the docker approach
+If you are working on a forked repo, you will need to use the local approach
below.
The most recently run staging CI pipeline will be published to this site. If
you
need to republish any branch, simply rerun the `Stage Site` workflow.
-## Setup for Docker
-
-To locally build and preview the site on your computer, you will need to build
-a docker container using these instructions:
+## Local Setup
+To locally build and preview the site on your computer, run
```shell
-git clone https://github.com/apache/infrastructure-actions.git
-cd infrastructure-actions
-docker build -t df-site-build pelican
+make
```
-Then within the directory that contains `datafusion-site` you can build and
test
-the site using:
-
-```shell
-docker run -it --rm -p8000:8000 -v $PWD:/site --entrypoint /bin/bash
df-site-build:latest
-pelicanasf content -o blog
-python3 -m http.server 8000
-```
+This will build the site using the
[`ASF-Pelican`](https://github.com/apache/infrastructure-actions/tree/main/pelican)
docker container.
Navigate in your web browser to
[http://localhost:8000/blog](http://localhost:8000/blog) to view the live
website. In your terminal you can press Ctrl+C and rerun the last two commands
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]