A Symbolic Links (also called symlink or softlink), is a special file which references another file or directory. These symlinks are very useful and are usually involved in zero-downtime deployments. A new release is prepared alongside the current version after which a single symlink change sets the new version live. Knowing how they work explains is therefor very useful when performing deployments or setting up a deployment pipeline.
Usage#
Create a new symlink#
Usage:
ln -s dir|file symlink_name
Example:
ln -s /var/www/domain/current /var/www/domain/releases/latest
Remove an existing symlink#
Usage:
rm symlink_name
Update an existing symlink#
Usage:
ln -sfn dir|file symlink_name
Example:
ln -sfn /var/www/domain/current /var/www/domain/releases/latest