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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠