0
votes

I am working on a pipeline with AWS Code pipeline using Jenkins as a build provider. Jenkins has a plugin(AWS CodePipeline plugin) to connect/poll with the pipeline.

Flow of the pipeline:

Source - CodeCommit Build - Jenkins Deploy - CloudFormation

Jenkins produces an output artifact(testart which contains imagedefinitions.json) that is uploaded to s3 using the plugin. For some reason, CloudFormation is able to find the artifact, but not the imagedefinitions.json file.

The error that I get in the deploy stage:

"File (imagedefinitions.json) does not exist in artifact (testart)".

PS: The pipeline has full permissions to access s3.

Any help is appreciated :)

2
Is the artifact just the zipped imagedefinitions.json file? Flat, without any directory structure?Milan Cermak
@MilanCermak it's just the file and not zip, there is no directory structure either. The AWS CodePipeline Plugin that Jenkins uses to upload the artifact says - If the location is a normal file: the file will be uploaded as-is (no compression). wiki.jenkins.io/display/JENKINS/AWS+CodePipeline+PluginDinesh Auti

2 Answers

2
votes

An artifact in a CodePipeline is a zipped directory. You refer to the files inside this dir:

.
└── JenkinsArtifact
    └── imagedefinitions.json

So you just need to put the imagedefinitions.json into a directory and have Jenkins zip it.

2
votes

The CloudFormation action expects a zip file, so you should configure Jenkins with a directory instead of a file.