CDK codebuild project - put code in a subdirectory?

0
Shorn
已提问 2 年前288 查看次数
1 回答
1

Using the BuildSpec.yml file for AWS CodeBuild provides control of your files once they have been cloned from GitHub. Consider using Linux commands to manipulate the location of your code as you need in the appropriate section of the BuidSpec.yml file. For example, you can do the following:

    - mkdir -p ./NewLocationForCodeWData/NewCodeSubDirectory
    - mkdir -p ./NewLocationForCodeWData/NewDataSubDirectory
    - mv ./GitHubRepoName/SpecificDirectory/* ./NewLocationForCodeWData/NewSubDirectory/
    - mv ./DataSubDirectory/* ./NewLocationForCodeWData/NewDataSubDirectory/

With the file system set up as you like, adjust the base-directory for in the artifacts section of BuildSpec.yml

    artifacts:
      base-directory: ./NewLocationForCodeWData

The zipped output of AWS CodeBuild will consist of the contents of the subfolder, NewLocationForCodeWData

profile picture
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则