awslabs / aws-codebuild-jenkins-plugin

AWS CodeBuild integration as a Jenkins build step.
https://aws.amazon.com/codebuild
Apache License 2.0
149 stars 122 forks source link

Specifying Buildspec when using multiple sources #83

Closed robbinscpcg closed 4 years ago

robbinscpcg commented 5 years ago

Is there a correct way to specify the buildspec path when using multiple sources? I have two sources, SOURCE1 and SOURCE2. SOURCE1 contains the application code; SOURCE2 contains my buildspec file. I've tried setting buildspec in my Jenkins pipeline with no success, as shown in the examples below - is there a correct way to set buildspec when using multiple sources? It appears that CodeBuild places you in the source directory of the first source specified; can you confirm that?

BuildSpec Attempts

Error shown below.


[Container] 2019/05/13 14:56:00 Waiting for DOWNLOAD_SOURCE 
[Container] 2019/05/13 14:56:21 Phase is DOWNLOAD_SOURCE 
[Container] 2019/05/13 14:56:21 CODEBUILD_SRC_DIR=C:\codebuild\tmp\output\src248\src\github.com\McKissockLP\SOURCE1
[Container] 2019/05/13 14:56:21 CODEBUILD_SRC_DIR_jenkins=C:\codebuild\tmp\output\src248\src\github.com\McKissockLP\SOURCE2
[Container] 2019/05/13 14:56:21 Phase complete: DOWNLOAD_SOURCE State: FAILED 
[Container] 2019/05/13 14:56:21 Phase context status code: YAML_FILE_ERROR Message: YAML file does not exist ```
leoherran-aws commented 5 years ago

Yes, $CODEBUILD_SRC_DIR is the directory from which the provided buildspec file is searched for. I can confirm that option two works, but you will need to specify the path with the keyword buildSpecFile like so: buildSpecFile: '../SOURCE2/buildspec-build.yml' (see the pipeline syntax helper for the awsCodeBuild step). Let me know if that works for you.

subinataws commented 4 years ago

No recent updates. Resolving.