Skip to content

Automating the release process #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions ReleaseProcess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# WebLogic Deploy Tooling Project Release Process
This document describes the process that should be followed to create a WebLogic Deploy Tooling (WDT) release.

## Prerequisites
- A local installation of WebLogic Server 12.2.1.x must be available.
- The person running the release process must have admin privileges on the [WebLogic Deploy Tooling GitHub repo](https://github.com/oracle/weblogic-deploy-tooling) since the release process pushes to the master branch directly.
- The person running the release process needs to create a GitHub Personal Access Token for the repository with (at least) the `repo:status`, `repo_deployment`, `public_repo`, and `security_events` privileges.
- The person running the release needs a server added to their Maven `settings.xml` where the GitHub Personal Access Token is stored, as shown below. Note that this token can either be stored in plain text of encrypted using [Maven password encryption](https://maven.apache.org/guides/mini/guide-encryption.html).

```xml
<servers>
<server>
<id>github</id>
<passphrase>store plain text or encrypted token here</passphrase>
</server>
</servers>
```

## Software Release Process
The best practice is to write the release notes that will be published to GitHub prior to starting the steps below.

1. Set (and export) the environment variable `WLST_DIR` to `<WLS-install-dir>/oracle_common/common/bin`, replacing `<WLS-install-dir>` with the full path to the WLS 12.2.1.x installation directory.
2. In the weblogic-deploy-tooling project directory, create a file called `release.properties` with content similar to the example shown below. Note that the example is configured to cut the 1.9.11 release.

```properties
tag=release-1.9.11
releaseVersion=1.9.11
developmentVersion=1.9.12-SNAPSHOT
```

3. In the weblogic-deploy-tooling project directory, run the `mvn -B -P release release:prepare release:perform` command. If your SSH private key has a passphrase, watch the build closely since it will prompt for your passphrase multiple times. Failure to enter it in a timely manner may result in a failure.
4. If the build fails, run the `mvn -B -P release release:rollback` command to undo it and start over from Step 2 after correcting the issue.
5. Once the software has been released, move on to the GitHub Release Process.

## GitHub Release Process
Note that this process relies on the WDT installers being in your local Maven repository. As such, it is critical for the same user to run these steps on the same machine as the steps from the previous section!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

installers? or installer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a second installer with a tar.gz extension


1. Save the release notes in the file `<wdt-project-directory>/target/ReleaseNotes.md`.
2. Run the command `mvn -f github-release.xml -DreleaseVersion=<release version number> verify` to create the draft GitHub Release.
3. Log into [GitHub](https://github.com/oracle/weblogic-deploy-tooling), go to the Releases page, review/edit the draft release, and then publish the release.
135 changes: 135 additions & 0 deletions github-release.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.oracle.weblogic.lifecycle</groupId>
<artifactId>weblogic-deploy-github-release</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<properties>
<releaseVersion>${env.VERSION_NUMBER}</releaseVersion>

<weblogic-deploy-installer-name>weblogic-deploy</weblogic-deploy-installer-name>
<release-github-repository>oracle/weblogic-deploy-tooling</release-github-repository>

<release-settings-xml-server-id>github</release-settings-xml-server-id>
<release-notes-file-name>${project.build.directory}/ReleaseNotes.md</release-notes-file-name>
<release-installer-stage-dir>${project.build.directory}/installers</release-installer-stage-dir>
<release-zip-installer-name>${weblogic-deploy-installer-name}.zip</release-zip-installer-name>
<release-tgz-installer-name>${weblogic-deploy-installer-name}.tar.gz</release-tgz-installer-name>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
</plugin>
<plugin>
<groupId>io.rhpatrick.mojo</groupId>
<artifactId>github-maven-plugin</artifactId>
<version>0.6</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-build-environment</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>releaseVersion</property>
<message>You must specify a release version number using -DreleaseVersion=x.y.z</message>
<regex>\d+\.\d+\.\d+</regex>
<regexMessage>You must provide a three place release number</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>stage-installer-artifacts</id>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${release-installer-stage-dir}</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>weblogic-deploy-installer</artifactId>
<version>${releaseVersion}</version>
<type>zip</type>
<overWrite>true</overWrite>
<destFileName>${release-zip-installer-name}</destFileName>
</artifactItem>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>weblogic-deploy-installer</artifactId>
<version>${releaseVersion}</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<destFileName>${release-tgz-installer-name}</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.rhpatrick.mojo</groupId>
<artifactId>github-maven-plugin</artifactId>
<executions>
<execution>
<id>create-draft-github-release</id>
<goals>
<goal>create-release</goal>
</goals>
<phase>verify</phase>
<configuration>
<repositoryId>${release-github-repository}</repositoryId>
<serverId>${release-settings-xml-server-id}</serverId>
<tag>release-${releaseVersion}</tag>
<name>WebLogic Deploy Tooling ${releaseVersion}</name>
<descriptionFile>${release-notes-file-name}</descriptionFile>
<draft>true</draft>
<assets>
<fileSet>
<directory>${release-installer-stage-dir}</directory>
<includes>
<include>${release-zip-installer-name}</include>
<include>${release-tgz-installer-name}</include>
</includes>
</fileSet>
</assets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1 change: 1 addition & 0 deletions installer/src/assembly/zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<id>zip</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
</formats>

<fileSets>
Expand Down
2 changes: 2 additions & 0 deletions system-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<artifactId>weblogic-deploy</artifactId>
<groupId>com.oracle.weblogic.lifecycle</groupId>
<version>1.9.11-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
Expand Down Expand Up @@ -117,6 +118,7 @@
<goal>enforce</goal>
</goals>
<configuration>
<skip>${skip-system-test-execution}</skip>
<rules>
<requireProperty>
<property>mw_home</property>
Expand Down