You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
We're trying to deploy a simple PHP project with no build process, all we need to do in the pipeline is `scp` copy the files up to a remote server.
Here's our pipeline config:
- pipe: atlassian/scp-deploy:0.3.3
SERVER: '<ip addr>'
We want it to put the files from the repo into /var/www/api/v1 on the remote machine, but instead it creates a `build` dir that looks like it has 777 permissions, and puts them in there. (/var/www/api/v1/build/<files>)
Where does this build dir come from? Can we disable that? Or do we have the wrong `LOCAL_PATH` value?
Thank you for your question.
In your case use:
To deploy only files from your directory to the remote you can provide '/local/path/build/*' with trailing asterisk symbol (*) as a LOCAL_PATH variable.
Pipe "SCP deploy" preserves modification times, access times, and modes from the original file. Try to check permissions on your local at first.
But additionally, you can add to your config "SSH run" pipe with a command that modifies targets permissions on the remote:
- pipe: atlassian/ssh-run:0.1.3
COMMAND: 'chmod 755 <your_target_file>'
More information about pipe "SSH run" you can find in the Bitbucket Pipelines SSH run repository.
Atlassian created pipes are kept in the Bitbucket Pipelines pipes project.
The problem is the trailing asterisk symbol (*) in the LOCAL_PATH variable leads to the fact that hidden files will not be copied (any files starting with "." - .htaccess, .env, etc). It is a general Linux behavior, but it would be nice to have some way to copy the hidden files and don't have a "build" directory on the server.
I found a solution: just use atlassian/rsync-deploy and a slash at the end of LOCAL_PATH. Then hidden files will be copied and "build" dir will not be created.
- pipe: atlassian/rsync-deploy:0.4.4