This is my first time using bitbucket pipeline to deploy changes to the server. I've tried a lot of scripts before and the script below seems to be the one that run successfully. But even though in bitbucket it says that the pipeline was successful, I can't find the updated or newly created file in the server hosting. But if the file was updated normally in bitbucket repository source.
Can anyone familiar with bitbucket pipeline help me? I basically want to automate deployment from master branch (when there is a push to master) to a remote server host via FTP.
Note: as for the FTP credentials, I have tried connecting it via apps like FileZilla and it works perfectly fine. So, the problem was not the FTP credentials
Hello @Indra Oei ,
Thank you for reaching out to Atlassian Community!
Accordingly to the git-ftp documentation , before using the ftp push, you should init the FTP tracking in the remote by executing the git ftp init :
git ftp init
You can clone the repository and execute the above command in your local, so all the files will be uploaded to the FTP site. After that, you should be able to normally execute the git ftp push in the pipelines to only synch the changed files.
In case the above does not work, I'd need more verbose logging for the investigation, so could you please update your pipeline to run the push with the -vv flag, like below ?
git ftp push -vv --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://$FTP_HOST
Once you run it with the verbose flag, please share with us the log output.
Additionally, as an alternative to git ftp you could also make use of the FTP pipe to deploy the files to your remote server, as the example below :
script:
- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: '<string>'
PASSWORD: '<string>'
SERVER: '<string>'
REMOTE_PATH: '<string>'
Pipe documentation and examples: https://bitbucket.org/product/features/pipelines/integrations?p=atlassian/ftp-deploy
Hope that helps! Let me know in case you have any questions.
Thank you, @Indra Oei .
Kind regards,
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.