Unable to create pipeline to only deploy changed files

Richard Bertematti November 30, 2023

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:

Configuration 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




2 answers

0 votes
Richard Bertematti December 1, 2023

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.

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 1, 2023

@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

Richard Bertematti December 1, 2023

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.

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 3, 2023

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

Like Sabine Mayer likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events