I'm trying to create pipeline to only deploy changed files. My yml file below passes the validator test, but when I run it I get this error:
There is an error in your bitbucket-pipelines.yml at [pipelines > branches > master > 0 > step > script > 2]. Missing or empty command string. Each item in this list should either be a single command string or a map defining a pipe invocation.
Also, I'm not sure if the includePaths of "/**" is valid to deploy changed files anywhere in the code, which is what I want.
Here is my yml:
pipelines:
branches:
master:
- step:
name: 'Deploy with SFTP to staging'
deployment: 'Staging'
condition:
changesets:
includePaths:
# any changes in frontend directory
- "/**"
script:
- echo "This step will use atlassian/sftp-deploy pipe"
- pipe: atlassian/sftp-deploy:0.5.11
- variables:
USER: $SFTP_USERNAME
SERVER: 'xx.xx.xx.xx'
REMOTE_PATH: '/home/user'
#LOCAL_PATH: '<string>' #Optional
SSH_KEY: $SSH_KEY
Wow, Igor, thanks! Now it at least processes. But to deploy ANY changed files in the repository, what do I have put in includePaths? I tried "/**" but it didn't seem to update anything.
@Richard Bertematti hi. The problem is here:
- pipe: atlassian/sftp-deploy:0.5.11
- variables:
...
instead of the example above you should use:
- pipe: atlassian/sftp-deploy:0.5.11
variables:
...
(remove dash from variables)
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow, Igor, thanks! Now it at least processes. But to deploy ANY changed files in the repository, what do I have put in includePaths? I tried "/**" but it didn't seem to update anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Richard Bertematti . According to this answer , and this answer i doubt that this is possible to deploy changed files with sftp-deploy pipe.
However, you could try to use rsync-deploy pipe:
script: - pipe: atlassian/rsync-deploy:0.11.1 variables: USER: 'ec2-user' SERVER: '127.0.0.1' REMOTE_PATH: '/var/www/build/' LOCAL_PATH: 'build'
Regards, Igor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.