The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Exclude folders in the upload step of aws-code-deploy

rickhaasteren
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 4, 2021

I'm using the aws-code-deploy to deploy my code to AWS. I have various folders in my repo that I don't need in the upload stel (like .git, src and tests). 

I noticed that the aws-s3-deploy pipe has the option to exclude certain folders using the EXTRA ARGS parameter, for instance like this:

EXTRA_ARGS: '--exclude=.git/* --exclude=src/* --exclude=tests/*

However, this doesn't seem to work for aws-code-deploy. Is there another way to exclude folders and files in the upload step?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Rick van Haasteren
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 11, 2021

The solution turned out to be excluding the folders in the zip command. Here's what I'm running now:

- step:
name: Build
script:
- cd app/../ && zip -r myapp.zip * .[^.]* -x 'tests/*' -x 'src/*' -x '.git/*' -x 'gulp/*'
artifacts:
- myapp.zip

This excludes the tests, src, gulp and .git folders. 

1 vote
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 5, 2021

@rickhaasteren  hi. Thanks for your question.

I did not found here how to exclude some folders from deploy. So i doubt we can implement such feature in aws-code-deploy pipe. Keep in mind that EXTRA_ARGS in aws-s3-deploy and aws-code-deploy are not the same variables.

After some investigation i found this article. Maybe it can help you.

Also when you do upload with aws-code-deploy you can provide needed ZIP_FILE (with excluded directories) before you do deploy with aws-code-deploy.

 

Regards, Igor

TAGS
AUG Leaders

Atlassian Community Events