Skip to content

Commit 9b0da00

Browse files
allow local previews of websites-sources cotnent using FF_S3_PATH (#31993)
1 parent 3fb0cfa commit 9b0da00

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

Makefile

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ GITHUB_TOKEN ?= ""
3131
FULL_BUILD ?= false
3232
CONFIGURATION_FILE ?= "./local/bin/py/build/configurations/pull_config_preview.yaml"
3333

34+
# Set default S3 path for websites sources data
35+
FF_S3_PATH ?= "staging"
36+
3437
help:
3538
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
3639

@@ -129,10 +132,16 @@ node_modules: package.json yarn.lock
129132
dependencies: clean
130133
make hugpython all-examples update_pre_build node_modules build-cdocs websites_sources_data build-llms-txt
131134

132-
# Download files from S3 bucket and add them to the file system
135+
# Download files from S3 bucket and add them to the file system.
136+
# Preview S3 content locally: add FF_S3_PATH env var when executing appropriate Make targets
137+
# e.g. make start-sources FF_S3_PATH=<websites-sources feature branch>
133138
websites_sources_data: hugpython
134-
@echo "Downloading data from websites-sources S3 bucket..."
135-
@. hugpython/bin/activate && python3 ./local/bin/py/build/get_websites_sources_data.py
139+
@echo "Removing _vendor directory..."
140+
rm -rf _vendor
141+
@echo "Downloading fresh data from websites-sources S3 bucket..."
142+
@. hugpython/bin/activate && \
143+
export FF_S3_PATH=${FF_S3_PATH} && \
144+
python3 ./local/bin/py/build/get_websites_sources_data.py
136145

137146
integrations_data/extracted/vector:
138147
$(call source_repo,vector,https://github.com/vectordotdev/vector.git,master,true,website/)
@@ -164,18 +173,18 @@ config:
164173
envsubst '$$CI_COMMIT_REF_NAME' < "config/$(CI_ENVIRONMENT_NAME)/params.yaml" | sponge "config/$(CI_ENVIRONMENT_NAME)/params.yaml"; \
165174
echo -e "\nbranch: ${CI_COMMIT_REF_NAME}" >> config/$(CI_ENVIRONMENT_NAME)/params.yaml;
166175

167-
# Automatically download the latest module from websites-sources repo
168-
update_websites_sources_module:
169-
node_modules/hugo-bin/vendor/hugo mod get github.com/DataDog/websites-sources@main
170-
node_modules/hugo-bin/vendor/hugo mod clean
171-
node_modules/hugo-bin/vendor/hugo mod tidy
172-
cat go.mod
173-
@if [ -n "$(CI_COMMIT_REF_NAME)" ]; then \
174-
echo "In ci, vendoring integrations pages for placeholder generation"; \
175-
node_modules/hugo-bin/vendor/hugo mod vendor; \
176-
cp -rpv _vendor/github.com/DataDog/websites-sources/content/en/integrations/. content/en/integrations/; \
177-
rm -rf _vendor; \
178-
fi
176+
# # Automatically download the latest module from websites-sources repo
177+
# update_websites_sources_module:
178+
# node_modules/hugo-bin/vendor/hugo mod get github.com/DataDog/websites-sources@main
179+
# node_modules/hugo-bin/vendor/hugo mod clean
180+
# node_modules/hugo-bin/vendor/hugo mod tidy
181+
# cat go.mod
182+
# @if [ -n "$(CI_COMMIT_REF_NAME)" ]; then \
183+
# echo "In ci, vendoring integrations pages for placeholder generation"; \
184+
# node_modules/hugo-bin/vendor/hugo mod vendor; \
185+
# cp -rpv _vendor/github.com/DataDog/websites-sources/content/en/integrations/. content/en/integrations/; \
186+
# rm -rf _vendor; \
187+
# fi
179188

180189
#######################################################################################################################
181190
# API Code Examples

0 commit comments

Comments
 (0)