-
Notifications
You must be signed in to change notification settings - Fork 35
Add document How to set up a persistent external symlink on deployment #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
poespas
wants to merge
3
commits into
master
Choose a base branch
from
How-to-set-up-a-persistent-external-symlink-on-deployment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...de-deploy/getting-started/set-up-a-persistent-external-symlink-on-deployment.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| description: Create a persistent external symlink in Hypernode Deploy that survives | ||
| releases and rollbacks. | ||
| title: How to set up a persistent external symlink on deployment | ||
| --- | ||
|
|
||
| # Set up a persistent external symlink on deployment | ||
|
|
||
| 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## Install the Hypernode Deploy configuration package | ||
|
|
||
| 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). | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Add the path that should become a symlink to the shared files configuration in your deploy.php config: | ||
|
|
||
| ```php | ||
| $configuration->setSharedFiles([ | ||
| 'pub/my-symlink' | ||
| ]); | ||
| ``` | ||
|
|
||
| 2. Deploy once. This will create the file at `~/apps/<appname>/shared/pub/my-symlink`. | ||
|
|
||
| 1. Replace the created file with a symlink to your external target. For example: | ||
|
|
||
| ```bash | ||
| ln -s ~/blog ~/apps/<appname>/shared/pub/my-symlink | ||
| ``` | ||
|
|
||
| 4. Deploy again. The symlink will be available in each new release and will persist across deployments. | ||
|
|
||
| ## Verify | ||
|
|
||
| After deployment, verify the symlink inside the current release: | ||
|
|
||
| ```bash | ||
| ls -l ~/apps/<appname>/current/pub/my-symlink | ||
| ``` | ||
|
|
||
| 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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was manually configured, because the order of the articles make sense. But, perhaps we can prefix them with a number or something.