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

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

.htaccess file is not copied over when I use BitBucket Pipelines Edited

Hi Team,

.htaccess files is not able to copied into server using bit-bucket pipeline , can i know the reason why like hidden files are not able to update the changes into server, when ever we have modified the bitbucket repository.

 

bitbucket-pipeline.yml

image: ubuntu:16.04
pipelines:
branches:
DevStaging:
- step:
name: PHP
script:
- apt-get update -y
- apt-get install -y zip
- apt-get install php libapache2-mod-php -y
- apt-get install curl -y
- zip -r artifact.zip *
- apt-get install sshpass -y
- time sshpass -p 'password' scp -o StrictHostKeyChecking=no -o LogLevel=DEBUG artifact.zip username@ipaddress:/home/usrname/deploy

 

Can you please give the solution ASAP.

 

Regards,

Venkat

1 answer

0 votes
mkleint Atlassian Team Oct 20, 2019

I assume that `zip -r artifact.zip *` is the step that should include the .htaccess file in your repository?

I believe zip by default will not include files starting with .

https://unix.stackexchange.com/questions/423017/how-to-zip-all-files-including-hidden-files-to-zip-file-using-linux-command

Yes I want to zip including .htaccess file also can you please guide me. what are the changes i want to do here ?

bitbucket-pipeline.yml

image: ubuntu:16.04
pipelines:
branches:
DevStaging:
- step:
name: PHP
script:
- apt-get update -y
- apt-get install -y zip
- apt-get install php libapache2-mod-php -y
- apt-get install curl -y
- zip -r artifact.zip *
- apt-get install sshpass -y
- time sshpass -p 'password' scp -o StrictHostKeyChecking=no -o LogLevel=DEBUG artifact.zip username@ipaddress:/home/usrname/deploy

mkleint Atlassian Team Oct 20, 2019

see the linked stackoverflow answer.

 

zip -r artifact.zip ??*

Hi Mkleint,

 

Thanks for your's reply , I have tested using the command " zip -r artifact.zip ??*" but no luck. Hidden files are not zipping.

 

bitbucket-pipelines.yml

 

image: ubuntu:16.04
pipelines:
branches:
Ydtwebstaging:
- step:
name: PHP
script:
- apt-get update -y
- apt-get install -y zip
- apt-get install php libapache2-mod-php -y
- apt-get install curl -y
- cd admin/back-end
- zip artifact.zip ??*
- apt-get install sshpass -y
- time sshpass -p 'password' scp -o StrictHostKeyChecking=no -o LogLevel=DEBUG artifact.zip username@ip:/home/username/deploy

- step:
image: node:10.15.0
name: NPM
script:
- apt-get update -y
- apt-get install -y zip
- cd admin/front-end
- npm install
- CI=false
- npm run build
- zip artifact1.zip ??*
- apt-get install sshpass -y
- time sshpass -p 'password' scp -o StrictHostKeyChecking=no -o LogLevel=DEBUG artifact1.zip username@ip:/home/username/deploy
- step:
name: api
script:
- apt-get update -y
- apt-get install -y zip
- apt-get install php libapache2-mod-php -y
- apt-get install curl -y
- cd Mobile_API_Setup
- zip artifactapi.zip ??*
- apt-get install sshpass -y
- time sshpass -p 'password' scp -o StrictHostKeyChecking=no -o LogLevel=DEBUG artifactapi.zip username@ip:/home/username/deploy

 

Like this i have used in my config file but it's not zipping the hidden files

Regards,

Venkat

mkleint Atlassian Team Oct 21, 2019

Ok. This question is not specific to pipelines. It's a general linux usage question. I've found this solution to work in my ubuntu docker image

root@b82cdad66040:~# zip 1.zip * .[^.]*
adding: file (stored 0%)
adding: .bash_history (stored 0%)
adding: .bashrc (deflated 54%)
adding: .dotted (stored 0%)
adding: .htaccess (stored 0%)
adding: .profile (deflated 20%)
root@b82cdad66040:~#

 

as per this stackoverflow - https://stackoverflow.com/questions/12493206/zip-including-hidden-files

Not sure if it only works in root folder or includes dotted files recursively.

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,849 views 0 7
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