Skip to content

Commit bdd6d3a

Browse files
authored
Merge pull request #412 from ByteInternet/How-to-set-up-a-persistent-external-symlink-on-deployment
Add document How to set up a persistent external symlink on deployment
2 parents 6df1301 + b7ff0c6 commit bdd6d3a

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

docs/hypernode-deploy/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ maxdepth: 1
1616
getting-started/install-and-configure-hypernode-deploy.md
1717
getting-started/configure-ci-cd.md
1818
getting-started/configure-hypernode-settings-on-deployment.md
19+
getting-started/set-up-a-persistent-external-symlink-on-deployment.md
1920
```
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)