# CircleCI copy files before AWS EBS Elastic Beanstalk Deployment

**URL:** <https://discuss.circleci.com/t/circleci-copy-files-before-aws-ebs-elastic-beanstalk-deployment/14348>\
**Category:** Deployments\
**Tags:** elasticbeanstalk, aws, circle-yml\
**Created:** [July 14, 2017, 5:17pm UTC](https://discuss.circleci.com/t/circleci-copy-files-before-aws-ebs-elastic-beanstalk-deployment/14348 "2017-07-14T17:17:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MPJHorner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mpjhorner/32/16563_2.png) [@MPJHorner](https://discuss.circleci.com/u/MPJHorner)\
**Post date:** [July 14, 2017, 5:17pm UTC](https://discuss.circleci.com/t/circleci-copy-files-before-aws-ebs-elastic-beanstalk-deployment/14348/1 "2017-07-14T17:17:50Z")

</div>

Please see my circleci ‘deployment’ code below…

```auto
deployment:
  dev:
    branch: dev
    commands:
      - cp .env.dev .env.use
      - ls -ld .?* 
      - eb use software-development --profile default
      - eb deploy --profile default

```

I want to copy `.env.use` so it can pick up the right env vars (I know it is not best practice, but useful for dev).

It does copy the files, as the command after confirms this…

However, when it get’s pushed Elastic Beanstalk those files do not exist.  
They are not in `.gitignore` and I don’t have the elastic beanstalk ignore file.

I am checking by having the following `.ebextensions`

```auto
    container_commands:
        01-enviroment-variables-exist-test:
            command: "ls -a /var/app/current"

```

It seems as if when i’m copying files they are seperate from what eb deploy picks up?

Any help much appreciated!

---

<div class="post-metadata">

**Author:** ![MPJHorner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mpjhorner/32/16563_2.png) [@MPJHorner](https://discuss.circleci.com/u/MPJHorner)\
**Post date:** [September 1, 2017, 7:38am UTC](https://discuss.circleci.com/t/circleci-copy-files-before-aws-ebs-elastic-beanstalk-deployment/14348/2 "2017-09-01T07:38:32Z")

</div>

Found the answer to my question.  
I basically got to git add / git commit.

It seems it pulls the latest commited version.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:41am UTC](https://discuss.circleci.com/t/circleci-copy-files-before-aws-ebs-elastic-beanstalk-deployment/14348/3 "2018-06-18T11:41:19Z")

</div>

Closed on June 18, 2018, 11:41am UTC


