Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to leave out fodlers in .yml file?

Rasmus Hye July 31, 2018

Hi!

 

I'm using Bitbucket Pipelines to deploy files to FTP server.

I need the .yml file to zip only one folder in my repository.

Currently I managed it to leave out all files, but does anyone know how to make it leave out folders?

 

The two folders I need it to leave out is /src and /node_modules. But it doesn't seem to work the same way as with the files.

 

This is my .yml code:

 

image: samueldebruyn/debian-git

pipelines:
default:
-
step:
script:
-
apt-get update
-
apt-get -qq install zip curl
-
zip -r $BITBUCKET_REPO_SLUG.zip . -x *.git* *.yml *.js *.wbl *.json *src* *node_modules*
-
curl -T $BITBUCKET_REPO_SLUG.zip ftp://left-out/ --user $FTP_USERNAME:$FTP_PASSWORD

 

1 answer

0 votes
Linette
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2018

Hi Rasmus,

You are SO CLOSE!! In your example, if you escape the asterisks with slashes it will work for you so the command should be:

            - zip -r $BITBUCKET_REPO_SLUG.zip . -x *.git* *.yml *.js *.wbl *.json \*src* \*node_modules*

 you could also try using quotes, but this seemed the most direct method to me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events