image: atlassian/default-image:2

pipelines:
  branches:
    dev:
      - step:
          name: Deploy to Test
          deployment: test
          script:
            - pipe: atlassian/rsync-deploy:0.6.0
              variables:
                USER: $USERAPI
                SERVER: $SERVERAPI
                REMOTE_PATH: "/home/xyfunnelsfle/devapi.flexifunnels.com"
                LOCAL_PATH: "*"
                DEBUG: "true"
                EXTRA_ARGS: "--exclude=node_modules/  --exclude=.bitbucket/ --exclude=.git/ --exclude=bitbucket-pipelines.yml --exclude=.gitignore" # Ignore these
      - step:
          name: change persmission
          script:
            - ssh $USERAPI@$SERVERAPI 'cd /home/xyfunnelsfle/devapi.flexifunnels.com && npm run deploy'
