So I'm trying to set up automated deployment to our LAMP server using Bitbucket Pipelines and the sftp-deploy pipe. Here is my bitbucket-pipelines.yml:
image: atlassian/default-image:2
pipelines:
branches:
master:
- step:
script:
- pipe: atlassian/sftp-deploy:0.3.1
variables:
USER: $SFTP_USER
SERVER: $REMOTE_HOST
REMOTE_PATH: $REMOTE_PATH
LOCAL_PATH: $BITBUCKET_CLONE_DIR
DEBUG: 'true'
deployment: 'production'
Two problems:
- I'm trying to deploy my files to a public_html folder, but the pipe creates a 'build' folder inside it and puts the files in there. That is not what I want, the files must be direct children of the public_html folder. How can I change this behavior?
- Apart from the creation of the build folder, the first run of this pipe works fine, but on successive runs, it fails. It keeps throwing errors like this:
remote open("<my_server>/public_html/build/.git/objects/40/002c7bb269367f3ae0966cd9ffaf96f80d66e3"): Permission denied File permissions can't be the problem, the user I login with owns the files the script is trying to open.
Can anyone help me out?