nginx / unit-docs

NGINX Unit's official website and documentation
https://unit.nginx.org
Creative Commons Attribution 4.0 International
49 stars 97 forks source link

Copy files from deploy/_downloads subdirectories into _downloads #95

Closed danielledeleo closed 3 months ago

danielledeleo commented 3 months ago

These files are guaranteed to have unique filenames because they originate from source/downloads together.

The end result:

 tree -lh deploy/_downloads
[ 640]  deploy/_downloads
├── [  96]  077feed4aa66df9c8eba6520fdfcae65
│   └── [1.3K]  Dockerfile.php.txt
├── [  96]  55f3fadb10a1bec1c359757ae72cb998
│   └── [2.5K]  Dockerfile.go.txt
├── [  96]  57c3dbaa35e8622ad7cfc7dd1b281c01
│   └── [1.9K]  Dockerfile.ruby.txt
├── [  96]  626b50fd97c76a7215539b7bd884cf2c
│   └── [1.8K]  grafana.patch
├── [  96]  8b892abde1148c9ef4f41e16953cd590
│   └── [1.6K]  Dockerfile.python.txt
├── [2.5K]  Dockerfile.go.txt
├── [1.5K]  Dockerfile.java.txt
├── [1.9K]  Dockerfile.nodejs.txt
├── [1.9K]  Dockerfile.perl.txt
├── [1.3K]  Dockerfile.php.txt
├── [1.6K]  Dockerfile.python.txt
├── [1.9K]  Dockerfile.ruby.txt
├── [  96]  b16e6c96d59a63357f36a3f0c11bf14c
│   └── [6.6K]  unit-openapi.Dockerfile
├── [  96]  b9d463a96f334c8dbf77fc013ace1ea6
│   └── [1.9K]  Dockerfile.nodejs.txt
├── [  96]  ce271af7025309218beb94578326a881
│   └── [1.9K]  Dockerfile.perl.txt
├── [  96]  ff1c18f7e9e3429b93de06ac50b4f5df
│   └── [1.5K]  Dockerfile.java.txt
├── [1.8K]  grafana.patch
└── [6.6K]  unit-openapi.Dockerfile
netlify[bot] commented 3 months ago

Deploy Preview for nginx-unit ready!

Name Link
Latest commit c26f6186e7ffaf6620bf0ab62ebdc790419e11ec
Latest deploy log https://app.netlify.com/sites/nginx-unit/deploys/65c4eb7135e4f80008d4f222
Deploy Preview https://deploy-preview-95--nginx-unit.netlify.app/howto/falcon
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

callahad commented 3 months ago

Any reason to copy vs using symlinks or hardlinks?

callahad commented 3 months ago

LGTM, feel free to merge.

Nit: Maybe explain in a Makefile comment or in the commit message why we're copying the files over. Especially that it's to ensure stable links for internal tests, but those URLs are not part of any public contract and do not necessarily need to be preserved indefinitely.

callahad commented 3 months ago

Might be better to move the copying to the site build target, so we also see it on local calls of make or make serve

diff --git a/Makefile b/Makefile
index 508643f..ffd2f0d 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,9 @@ EXCLUDE = \

 site: $(BUILDDIR)
    @$(SPHINX) -E -b nxt_html source "$(BUILDDIR)"
+# Note: copy files in _downloads/<HASH>/* to _downloads/* to maintain
+# the previous webroot structure for use in internal tests.
+   cp $(BUILDDIR)/_downloads/*/* $(BUILDDIR)/_downloads

 $(BUILDDIR):
    mkdir "$(BUILDDIR)"
@@ -51,8 +54,4 @@ deploy: site
    -rm -rf "$(TMP)"
    mkdir $(DEPLOYDIR)/.well-known
    curl -L $(UNIT_SECURITY) -o "$(DEPLOYDIR)/.well-known/security.txt" 2>/dev/null
-
-# Note: copy files in _downloads/<HASH>/* to _downloads/* to maintain
-# the previous webroot structure for use in internal tests.
-   cp $(DEPLOYDIR)/_downloads/*/* $(DEPLOYDIR)/_downloads
    chmod -R g=u "$(DEPLOYDIR)"