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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,728
Community Members
 
Community Events
184
Community Groups

Pipeline: How to collect files into build-folder before FTP upload??

Edited

Hello,

on my local computer I have a repo with php-code like this:

  • index.php
  • sub-folder/.htaccess
  • sub-folder/.htpasswd

Because for local development and testing I have a local web server which points to the root-folder I can easily access my index.php without the htaccess-check.

But on my online-server (for other users) I want to have a result like this:

  • index.php
  • .htaccess
  • .htpasswd

My question: How can I do this with Bitbucket Pipeline?

I need ideas please how to move the 2 files from the sub-folder to root-directory during the build process.

The upload via FTP is already running... here a part from my bitbucket-pipelines.yml:

- pipe: atlassian/ftp-deploy:0.3.7
variables:
USER: $FTP_USER
SERVER: ftp.strato.de
REMOTE_PATH: /
PASSWORD: $FTP_PASSWORD

 

If you have better ideas instead of atlassian/ftp-deploy I'm open for ideas too :-) 

 

PS: SFTP is not running with Strato... For ssh.strato.de there was this error message coming up > but FTP was working: 

Bildschirm­foto 2022-11-23 um 17.32.21.png

 

Many thanks :-)

Michael

2 answers

any ideas on my question??

Update

I found another solution with .htaccess which I want to share with you.

In my repo I work now with this:

  • index.php
  • .htaccess
  • .htpasswd

And I updated the .htaccess by a host-check... Which is possible in Apache...

<If "req('Host') == 'domain-xyz.com'">
AuthName "Prompt"
AuthType Basic
AuthUserFile /home/htdocs/domain-xyz.com/.htpasswd
Require valid-user
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
</If>
<Else>
Require all granted
</Else>

So now the htaccess-protection is only used on my online server (host = domain-xyz.com), but not on my local dev environment.

 

BUT: I'm interested in a solution for my question too :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events