0
votes

I am trying to use AWS CodeBuild for building my code from github. These are the steps I followed so far,

  • 1) Created a windows docker image with all the pre-req software needed (git, npm, node.js etc) and pushed to Amazon ECS.
  • 2)Created a project in AWS CodeBuild using

  • a) github as the source (What to build)

  • b) docker image created in Step 1 (How to build)

    I setup buildspec.yml as below:

env:

#variables:    
#parameter-store:    
phases:
#install:     
#pre_build:    
build:
commands:
    - git clone https://github.com/OrgName/RepName.git "c:\www\localfolder"     
#post_build:    
#artifacts:
 #files:

But this is always failing during DOWNLOAD_SOURCE STEP saying "CodeBuild is experiencing Issues"

Please suggest how to setup buildspec.yml for github clone\fetch\checkout purpose.

Thanks.

1

1 Answers

0
votes

The issue you encountered may not be related to git clone\fetch\checkout failure. The build could also fail at "DOWNLOAD_SOURCE" step if CodeBuild failed/timed out when pulling the Windows Docker image; especially when the image is large.

Workarounds you can try:

1) use the windows image provided by CodeBuild and install the pre-req software during the install phase. (you will need to update your buildspec.yml)

OR

2) use a BUILD_GENERAL1_LARGE instance. maybe you will need to increase the timeout too.