Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

atlassian/sftp-deploy deploying files under build folder on remote server

Problem: i am using atlassian/sftp-deploy to deploy my final master push to live server .  i don't know  what is worng but its deploying my files under build folder on my remote server: 

REMOTE_PATH: '/var/www/html/'
LOCAL_PATH: $(pwd) (not sure even its right )

 

1 answer

0 votes
mwatson Atlassian Team Mar 24, 2019

Hi Sunny,

`$(pwd)` is resolving to `/opt/atlassian/pipelines/agent/build` so sftp is taking that path and copying everything to your remote, i.e. /opt/atlassian/pipelines/agent/build/wibble gets copied to /var/www/html/build/wibble. If you change `$(pwd)` to `.` I'm guessing it will then copy ./wibble to /var/www/html/./wibble, which is actually just /var/www/html/wibble, which should be what you want.

Hope this helps,

Matt

HI @mwatson  thanks for answer. Somehow it work with /opt/atlassian/pipelines/agent/build*   by putting '*' in front. but Now the problem is its  uploading full source code. I want to upload only newly  pushed  code  to be upload to the deployment  . 

I don't know if its even possible . currently i am creating zip [which contain all the code. that's issue. and uploading to live server here is my current yml file.


pipelines:
branches: # Automated triggers on commits to branches
master: # -- When committing to master branch
- step:
name: Deploy to production
deployment: production
script:
- apt-get update # required to install zip
- apt-get install -y zip # required for packaging up the application
# - zip -r /tmp/hutchh.zip *
- zip -r /opt/atlassian/pipelines/agent/build/hutchh.zip '/opt/atlassian/pipelines/agent/build/'
- pipe: atlassian/sftp-deploy:0.3.1
variables:
USER: 'webuser'
SERVER: '54.66.217.82'
REMOTE_PATH: '/var/www/html/'
LOCAL_PATH: '/opt/atlassian/pipelines/agent/build/hutchh.zip'

I want to zip and upload only files that are commit or pushed to master branch. not all source which currently happening 

thanks

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,218 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you