- 最新
- 最多得票
- 最多評論
I have it working! I will post my findings for others going that might be struggling -
So I figured out that the "Outputs" means what are all the files and/or directories that you want to go into your final artifact after all is built.
I have two directories that I want in the final jar artifact. One is WebContent and the other is build. They both have multiple sub-directories. I put "WebContent/,build/" in the output files field. It gave me a jar artifact but when I open the jar it did not have any sub-directories. In order to get it to include all sub-directories I had to make the output files field with "WebContent//,build//". All sub-directories are now in the zip and it appears as if the build was successful.
Hopefully this can help others out.
Now on to creating a script for this and also getting this to work from GitLab.
Edited by: ernievd on Mar 22, 2019 6:32 AM
Hi ernievd,
This could be a misconfiguration of the build source. Can you PM me a build ARN for a failing build? I'd be happy to look into this for you.
Thanks Joseph! Any help is appreciated!!
I figured out my issue - I zipped the build files from the folder level and not the root level. I re-zipped and it can now see the build.xml.
The next issue I have is that in my original build.xml it was getting the tomcat library files from my local computer - <fileset dir="/usr/local/tomcat/lib">
To overcome this I manually copied the files in that lib directory, put them in a new location in the zip file and then updated the build.xml to look at the new location. Is there any way to tell CodeBuild to look for files on the local computer or do i always have to have these tomcat files in the zipped file?
I built again with these changes and it looks like I am close! It failed for the following -
[Container] 2019/03/21 20:57:13 Phase complete: BUILD Success: true
[Container] 2019/03/21 20:57:13 Phase context status code: Message:
[Container] 2019/03/21 20:57:13 Entering phase POST_BUILD
[Container] 2019/03/21 20:57:13 Phase complete: POST_BUILD Success: true
[Container] 2019/03/21 20:57:13 Phase context status code: Message:
[Container] 2019/03/21 20:57:13 Expanding base directory path: .
[Container] 2019/03/21 20:57:13 Assembling file list
[Container] 2019/03/21 20:57:13 Expanding .
[Container] 2019/03/21 20:57:13 Expanding artifact file paths for base directory .
[Container] 2019/03/21 20:57:13 Assembling file list
[Container] 2019/03/21 20:57:13 Expanding myapp.jar
[Container] 2019/03/21 20:57:13 Skipping invalid artifact path myapp.jar
[Container] 2019/03/21 20:57:13 Phase complete: UPLOAD_ARTIFACTS Success: false
[Container] 2019/03/21 20:57:13 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found
The arn is -
arn:aws:codebuild:us-east-1:499000881936:build/TroveBuild:db1f5206-228d-46aa-9450-82407546ad17
Hi ernievd,
You could build a customer docker image that has these files in the same area as you desktop. If you don't want to do this then putting them in your zip is a great solution.
Looks like your running into an issue where we can't find the artifact file that you specified named myapp.jar. I would do an
ls
and see if that file is in your base directory or if its somewhere else like
bin/myapp.jar
.
John
Isn't bin/myapp.jar what the build is creating?
I am very confused as to what the Artifact/name should be - isn't this what is being created from the build? It is asking for an ARN - how can there be an ARN for it when it is not created?
Also very confused as to what the Environment/Output files is? It is required but I have no idea what should go in this field? It states that output files can not be empty. Does this mean it wants all the class files that are being built? If so then this build is creating over 30 class files in multiple locations - that is a ton to list.
Thanks
Ernie
Hi ernievd,
You'll need the artifacts' files:
section of your buildspec.yml to include the path to your jar. This is how CodeBuild determines which files should be considered artifacts. From your logs, it looks like the path may not be correct.
The Project configuration and artifact path/namespace/name tells CodeBuild where you want these artifacts to go after the build, and how you want them (re)named and packaged.
相關內容
- 已提問 1 年前
- 已提問 6 個月前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前