Release Job

inspectIT releases are built completely automated. By that we not only mean that the software bundles are created automatically, but also all organisational tasks, like creating release notes or changing the download link on the inspectIT homepage is automated. This automation allows us to release often and with a high quality. We cannot forget steps and we cannot make errors during the release. 

 

Goal: 

  • Create a new release of inspectIT based on the current stable branch

  • Actually no need to run all quality checks again

Parameters

  • Release type: The type of release that is intended to be built

  • potentially the release number?

 

Open

  • Create JIRA tasks or at least inform via mail that some tasks needs to be done (e.g. Documentation switch / update)

  • Check if it is possible to automatically start the switch/update of documentation spaces. For each stable release (which leads to a new major version), a new documentation space needs to be created (see Documentation Spaces)

  • Think on whether the released artifacts get the stable/preview as name in the artefact or not

  • Write the Homepage release description with each release and upload to FTP. (assigned to Henning Schulz  INSPECTIT-1918 - Getting issue details... STATUS )

  • Automatically release the JIRA version and create release description from JIRA (trigger release version) - Jira Release Mapping

  • Automatically create the manual tasks Necessary (manual) tasks of the inspectIT team for each release for the next JIRA version (if this JIRA version does not exist yet, create the version)

 

Conceptual Plan / Questions

  • How is this script triggered? Is it integrated into the specific Jenkins jobs?
    In my opinion, the best solution would be to write the job as a jenkins plugin, because java code is the most appropriate for solving such a complex task in a well structured manner.
    A Jenkins Plugin will be written allowing the creation of Issues and modifying the JIRA versions of a project.
  • Automatic creation of a new documentation space is not easy, as it is required to be copied.
    • Documentation space creation will not be done by the plugin, instead a ticket for this task will be automatically created.
  • Automatic creation of manual tasks in JIRA will be realized through the Jenkins plugin mentioned above.

 

Existing Jenkins Plugins

PluginFeatures
Confluence Publisher PluginPublishes the latest built from Jenkins as attachment onto a confluence page
Jenkins / JIRA Plugin

visualizes build data in JIRA, see the documentation for a full feature list.

Does not allow creating new issues.

 

Other Libraries

LibraryFeature
JIRA Rest Client for JavaAllows easy access of the JIRA rest service from Java

 

 

Accessing REST service from Java

There is a test user available on the diagnoseIT Confluence: jenkins.test with password "JenkServ".


Below there is a code snipped trying to read out the content of the page.

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;


public class Main {

private static final String PW = "***";
private static final String USER = "jenkins.test";

    public static void main(String[] args) {
        HttpAuthenticationFeature feature = HttpAuthenticationFeature
                .basicBuilder()
                .credentials(USER, PW).build();

        ClientConfig clientConfig = new ClientConfig();
        clientConfig.register(feature);

        Client client = ClientBuilder.newClient(clientConfig);
        
        
        WebTarget target = client.target("https://diagnoseit.atlassian.net/wiki")
            .path("rest").path("api").path("content");
        
        
        Response response = target.request().get();
        System.out.println(response.readEntity(String.class));
    }

}

 

The rest api delivers the content tree only with a limited depth when trying to fetch an entire space.
With the "expand" parameter for the REST-request it is possible to fetch the unexpanded data too, however it is necessary which data is expandable in advance.
For each fetched element (e.g. a page) there is a "_expandable" attribute included containing all expendable data, so an iterative fetching would be necessary.
See https://developer.atlassian.com/confdev/confluence-rest-api/expansions-in-the-rest-api for more information.