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
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 .
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
see the linked stackoverflow answer.
zip -r artifact.zip ??*
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.