Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Pipelines with Git Ftp and Composer Edited

Hello,

I am using Bitbucket Pipeline along with Git-Ftp for months. So far it is really good. Now I have landed into a problem which needs your suggestions.

I have implemented composer packages into the system and I would like to run "composer update" command into the server only when the upload ready file list contents "composer.json" and "composer.lock" file.

For that I believe, I have to run a shell file as a script in the pipeline? The problems are:

  1. How do I know the file names while a pipeline is running? I searched the available environment variables (https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html) page but couldn't find any.
  2. If the problem #1 can be resolved then, I'd like to run composer update into the server directly. Is that possible? Do I have to add that server's SSH key into bitbucket? Can you please point me to a guide?

Right now, I have a very straight forward pipeline script which puts files into 'public_html' directory of my site. In the server, I do have SSH access credentials and composer is also installed.

image: samueldebruyn/debian-git

pipelines:
# Automated builds.
branches:
# Automated build into Development.
development:
- step:
name: Automated Development Build
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://$FTP_HOST/public_html/

 

 

 I could have used Git-Ftp's feature ".git-ftp-include wildcards". But it would upload all contents of the "vendor" directory every time if composer.json/.lock file is changed. I only want to run composer command in the server itself. So I can save pipeline build minutes.

 

Please suggest.

Regards,

Aneek

 

2 answers

@Aneek Mukhopadhyay , have you solved this issue?

I'm working on this problem and I've found these links which might help.

The gist of the problem is that after you run build commands you want to tell FTP to include them in the transfer. It definitely would be better to do this over SSH but if like me you're not so hot with devops, sending it over FTP feels easier.

I haven't solved the problem yet but I'll post my answer here if I do.

Suggest an answer

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

Bitbucket Pipelines Runners is now in open beta

We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...

779 views 15 10
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