Search code examples
amazon-web-servicesaws-code-deployaws-codepipeline

Need to move deployed folder - AWS CodeDeploy


So I want to deploy my application. I have a moving script that moves all the deployed files to where they need to be sent.

But when that script is running in BeforeInstall phase it's not capable of finding the files.

enter image description here

So I added a pwd to the script and the directory is "deployment-root". I suppose I need to cd into the deployment folder, but the id is always different.

Is there any way I can get that id in my appspec.yml file so that I can cd into it in my deploy scripts?

Thanks,


Solution

  • You don't have to do a manual copy, in appspect.yml, in "files" section, you can specify what and where your files copied to.

    files:
      - source: Config/config.txt
        destination: /webapps/Config
      - source: source
        destination: /webapps/myApp
    
    Provides information to CodeDeploy about which files from your application revision should be installed on the instance during the deployment's Install event.
    

    More details via this page: https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-files.html