Skip to content

Commit eeedf09

Browse files
author
Jonathan Visser
committed
Add document How to set up a persistent external symlink on deployment
1 parent 0cdd9ea commit eeedf09

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
myst:
3+
html_meta:
4+
description: Create a persistent external symlink in Hypernode Deploy that survives
5+
releases and rollbacks.
6+
title: How to set up a persistent external symlink on deployment
7+
---
8+
9+
# Set up a persistent external symlink on deployment
10+
11+
Sometimes it's important to have a persistent symlink that leads to a folder outside of your application, for example a subfolder blog, or external sitemaps.
12+
13+
This pattern is useful when you want to expose content that lives outside the current release directory, while keeping it available and stable across deployments and rollbacks. By registering the path as a "shared file" in Hypernode Deploy, the final path in each release becomes a symlink to the shared area, which you can then point to any external location you need.
14+
15+
## Install the Hypernode Deploy configuration package
16+
17+
Make sure you have Hypernode Deploy set up and configured. If you haven't done this yet, follow the guide in [Install and configure Hypernode Deploy](install-and-configure-hypernode-deploy.md).
18+
19+
## Steps
20+
21+
1. Add the path that should become a symlink to the shared files configuration in your deploy.php config:
22+
23+
```php
24+
$configuration->setSharedFiles([
25+
'pub/my-symlink'
26+
]);
27+
```
28+
29+
2. Deploy once. This will create the file at `~/apps/<appname>/shared/pub/my-symlink`.
30+
31+
1. Replace the created file with a symlink to your external target. For example:
32+
33+
```bash
34+
ln -s ~/blog ~/apps/<appname>/shared/pub/my-symlink
35+
```
36+
37+
4. Deploy again. The symlink will be available in each new release and will persist across deployments.
38+
39+
## Verify
40+
41+
After deployment, verify the symlink inside the current release:
42+
43+
```bash
44+
ls -l ~/apps/<appname>/current/pub/my-symlink
45+
```
46+
47+
You should see it pointing to your external target (e.g., `~/blog`). If you open the URL that maps to `pub/my-symlink` in your site, the content should load from the external path.

0 commit comments

Comments
 (0)