I use Bitbucket to house and deploy code for a couple of small websites I've developed. I currently use Bitbucket Pipelines to push any updated files in a pull request for the `deploy` branch to hosting web servers via FTP. Git FTP is nice for this, because it will only push changed files to the web server, and also allows me to specify files to ignore and/or forcibly include, via `.git-ftp-ignore` and `.git-ftp-include` config files. Here's what my `bitbucket-pipelines.yml` file looks like to do this:
pipelines:
default:
- step:
script:
- echo "No deployment occurred (non-production branch)."
branches:
deploy:
- step:
script:
- sudo -s
- add-apt-repository ppa:git-ftp/ppa
- apt-get update
- apt-get -qq install git-ftp
- git ftp push -u $FTP_USERNAME -p $FTP_PASSWORD $FTP_URL
One of my clients (an illustrator) stores samples of her digital artwork in Cloudinary, and I also have the need to store a couple of CSS and JS files there. Whenever I make updates to those files, I currently upload them manually via Cloudinary's web interface, but I'd like to do this in an automated fashion as part of my Bitbucket pipeline, if possible (i.e., if a given pull request contains updated files that should be stored in Cloudinary, they will be pushed there via FTP or some other means).
Cloudinary has a well-documented API, which I imagine is what I need to do what I'm explaining here, however I'm not familiar at all with using APIs and, unfortunately, I become a bit lost when reading through all the docs! I was hoping that someone in this community with more experience in this sort of thing could "throw me a bone" and offer a clear explanation/example of how to get this going.
Here are some links to what I think might be the applicable documentation from Cloudinary:
If anyone can please help point me in the right direction, it would be greatly appreciated. Thank you!