Skip to content

The versionfile parameter is not working.  #105

@Patrick-Magee

Description

@Patrick-Magee

No matter what I entered for this parameter, it still generates a temporary file name for the S3 bucket.
CodeDeploy-plug-in

private RevisionLocation zipAndUpload(AWSClients aws, String projectName, FilePath sourceDirectory) throws IOException, InterruptedException, IllegalArgumentException {

    File zipFile = null;
    File versionFile;
    versionFile = new File(sourceDirectory + "/" + versionFileName);

    InputStreamReader reader = null;
    String version = null;
    try {
      reader = new InputStreamReader(new FileInputStream(versionFile), "UTF-8");
      char[] chars = new char[(int) versionFile.length() -1];
      reader.read(chars);
      version = new String(chars);
      reader.close();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      if(reader !=null){reader.close();}
    }

    if (version != null){
      zipFile = new File("/tmp/" + projectName + "-" + version + ".zip");
      final boolean fileCreated = zipFile.createNewFile();
      if (!fileCreated) {
        logger.println("File already exists, overwriting: " + zipFile.getPath());
      }
    } else {
      zipFile = File.createTempFile(projectName + "-", ".zip");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions