Trying to set up SFTP deploy but copying the sample code into my yml file causes an error no matter how I seem to do the indentation. First time doing anything like this so any help appreciated.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: php:7.1.1
pipelines:
default:
- step:
caches:
- composer
script:
- pipe: atlassian/sftp-deploy:0.3.1
variables:
USER: '<string>'
SERVER: '<string>'
REMOTE_PATH: '<string>'
LOCAL_PATH: '<string>'
# SSH_KEY: '<string>' # Optional.
# EXTRA_ARGS: '<string>' # Optional.
# DEBUG: '<boolean>' # Optional.
script:
- echo "Deploying to test environment"
- apt-get update && apt-get install -y unzip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- vendor/bin/phpunit
Hey @jhorning-tyler ,
You need to fill in the pipe parameters (i.e. replacing <string> with the values you want to use).
For example:
pipelines:
default:
- step:
name: Deploy text file
script:
- echo "blah" > test-file.txt
- pipe: atlassian/sftp-deploy:0.3.1
variables:
USER: ec2-user
SERVER: 13.236.114.90
REMOTE_PATH: "/opt/sftp-test/"
LOCAL_PATH: "test-file.txt"
Hi Raul,
Thanks for the reply! I should have mentioned I left those in my post just to keep my server info private. This morning, I moved the -pipe section to the bottom and that fixed that error. Now, I have one more question: What is the IP address of the Bitbucket machine that will be hitting our server? Our server/network guy has locked down our SFTP so that it only works if you are on our server and I think that is the reason the pipeline is failing at composer install. Let me know if I need to create a new post since that is an unrelated issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@jhorning-tyler you should whitelist all IP ranges listed under 'Valid IP addresses for Bitbucket Pipelines build environments' at https://confluence.atlassian.com/bitbucket/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall-343343385.html
If you are using ssh or scp and will be performing host verification via the Pipelines UI, you will also need to whitelist IPs listed under 'Valid IP addresses for Bitbucket Pipelines services' (ssh key scans for host key verification are performed from Bitbucket Pipelines services).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, great! I will pass this info on. Thank you so much for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can i duplicate LOCALPATH and REMOTE PATH?
USER: ec2-user
SERVER: 13.236.114.90
REMOTE_PATH: "/opt/sftp-test/"
LOCAL_PATH: "test-file.txt"
REMOTE_PATH: "/opt/sftp-test2/"
LOCAL_PATH: "test-file.txt"
??
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@daniellucena2 if you need to copy to two locations, you need to use two pipes. You can also run such scripts in parallel steps. Check out the doc https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#parallel
Regards, Galyna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.