Not sure if this is the correct SO as in not sure if this to be asked in the server section...where is that?
I have a bash file that gets called after a deployment from bitbucket pipelines:
#!/bin/bash
FILENAME=$1
DIR="/var/www/html/$FILENAME"
# $FILENAME can be, for example, foo_<build_number>
# Remove symlink
sudo rm -f /var/www/html/build
# Extract and copies the dist folder to the location below:
sudo mkdir -p $DIR && sudo tar -xvf "$FILENAME".tgz -C $DIR
sudo chown -R $USER:$USER $DIR
# Add new symlink
sudo ln -s $DIR/build /var/www/html/build
# Delete file after:
rm "$FILENAME".tgz
In the folder html
, I have a symlink that links to the last deployment. When I go into that folder, the build
is pointing to the correct folder but the changes not working (code changes that I have made in that new folder). What work is that I have to manually remove symlink and add back the symlink, as in code above. Why is that? How to do this properly?