Util.getCodeRevisionS3Details = function()

in pipeline/local_modules/pipeline_utils/pipeline_utils.js [87:103]


Util.getCodeRevisionS3Details = function (jobData, artifactName) {
  var artifact = null;
  jobData.inputArtifacts.forEach(function (a) {
    if (a.name == artifactName) {
      artifact = a;
    }
  });

  if (artifact !== null && artifact.location.type == 'S3') {
    var s3Info = {
      Bucket: artifact.location.s3Location.bucketName,
      Key: artifact.location.s3Location.objectKey
    };
    return s3Info;
  }
  throw new Error("Cannot find code revision S3 details for CodePipeline input artifact: " + artifactName);
}