Skip to content

Commit

Permalink
Enable automatic release on merge to master (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Mar 28, 2021
1 parent 4f058ed commit 1c1f794
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_extends: .github
58 changes: 58 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Note: additional setup is required, see https://github.com/jenkinsci/incrementals-tools#automatic-deployment

name: cd
on:
workflow_dispatch:
check_run:
types:
- completed

jobs:
validate:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.verify-ci-status.outputs.result == 'success' && steps.interesting-categories.outputs.interesting == 'true' }}
steps:
- name: Verify CI status
uses: jenkins-infra/[email protected]
id: verify-ci-status
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
output_result: true

- name: Release Drafter
uses: release-drafter/release-drafter@v5
if: steps.verify-ci-status.outputs.result == 'success'
with:
name: next
tag: next
version: next
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check interesting categories
uses: jenkins-infra/[email protected]
id: interesting-categories
if: steps.verify-ci-status.outputs.result == 'success'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
needs: [validate]
if: needs.validate.outputs.should_release == 'true'
steps:
- name: Check out
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Release
uses: jenkins-infra/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
<version>1.2</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
-Dchangelist.format=%d.v%s
10 changes: 5 additions & 5 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<property name="message" value="Line has trailing spaces."/>
</module>

<module name="LineLength">
<property name="max" value="120"/>
</module>

<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
Expand Down Expand Up @@ -73,9 +77,6 @@

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="MethodLength"/>

<!-- Checks for whitespace -->
Expand Down Expand Up @@ -133,9 +134,8 @@
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
<module name="FileContentsHolder"/>
<module name="SuppressionCommentFilter"/>
</module>

<module name="SuppressionCommentFilter"/>

</module>
26 changes: 16 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.13</version>
<version>4.17</version>
</parent>

<artifactId>azure-vm-agents</artifactId>
<version>${revision}${changelist}</version>
<version>${changelist}</version>
<packaging>hpi</packaging>

<name>Azure VM Agents</name>
Expand All @@ -36,15 +36,15 @@
</developers>

<scm>
<connection>scm:git:ssh://[email protected]/jenkinsci/azure-vm-agents-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/azure-vm-agents-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/azure-vm-agents-plugin</url>
<connection>scm:git:ssh://[email protected]/${gitHubRepo}.git</connection>
<developerConnection>scm:git:ssh://[email protected]/${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>

<properties>
<revision>1.5.4</revision>
<changelist>-SNAPSHOT</changelist>
<changelist>9999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/azure-vm-agents-plugin</gitHubRepo>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<azuresdk.version>1.19.0</azuresdk.version>
Expand All @@ -58,15 +58,14 @@
<azure-credentials.version>1.6.1</azure-credentials.version>
<azure-commons.version>1.1.0</azure-commons.version>
<guava.version>24.1.1-jre</guava.version>
<configuration-as-code.version>1.35</configuration-as-code.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.263.x</artifactId>
<version>17</version>
<version>26</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down Expand Up @@ -288,7 +287,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<version>3.1.1</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.41</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ public T withDoNotUseMachineIfInitFails(boolean doNotUseMachineIfInitFails) {
public T withEnableMSI(boolean enableMSI) {
this.enableMSI = enableMSI;
return (T) this;
}
}

public T withEnableUAMI(boolean enableUAMI) {
this.enableUAMI = enableUAMI;
return (T) this;
}

public T withGetUamiID(String uamiID) {
this.uamiID = uamiID;
return (T) this;
Expand Down
61 changes: 41 additions & 20 deletions src/main/resources/com/microsoft/azure/vmagent/Messages.properties
Original file line number Diff line number Diff line change
@@ -1,34 +1,48 @@
# Global configuration - validations
Azure_Config_Success=Successfully verified Azure configuration.
Azure_GC_InitScript_Warn_Msg=Ensure image is pre-configured with a Java runtime or provide a script to install Java in headless (silent) mode. \
Azure_GC_InitScript_Warn_Msg=Ensure image is pre-configured with a Java runtime or provide a script \
to install Java in headless (silent) mode. \
\nIf using JNLP, see README.md for a sample script.
Azure_GC_LaunchMethod_Warn_Msg=Make sure the Azure agent can reach the controller via the Jenkins URL. Refer to the help for details.
Azure_GC_TemplateStatus_Warn_Msg=The template is marked as disabled. Check the template status details in the Advanced section.
Azure_GC_LaunchMethod_Warn_Msg=Make sure the Azure agent can reach the controller via the Jenkins URL. \
Refer to the help for details.
Azure_GC_TemplateStatus_Warn_Msg=The template is marked as disabled. Check the template status details in \
the Advanced section.

Azure_GC_OS_Type_Unknown_Err=Unknown OS type. Should be Linux or Windows

Azure_GC_UserName_Err=Not a valid user name. The user name must contain between 3 and 15 characters: alphanumerics, underscore or hyphen.
Azure_GC_Password_Err=Required: Not a valid password. The password length must be between 8 and 123 characters. It also needs to have at least one digit, one lowercase and one uppercase letter.
Azure_GC_UserName_Err=Not a valid user name. The user name must contain between 3 and 15 characters: \
alphanumerics, underscore or hyphen.
Azure_GC_Password_Err=Required: Not a valid password. The password length must be between 8 and 123 characters. \
It also needs to have at least one digit, one lowercase and one uppercase letter.
Azure_GC_JVM_Option_Err=Error: Not a valid JVM Option. JVM options should start with a hyphen(-). e.g. -Xmx1500m
Azure_GC_Template_Error_List=The following errors occurred while validating the template.

Azure_GC_Template_Val_Profile_Missing=The profile configuration is missing. Configure an Azure profile first.
Azure_GC_Template_ResourceGroupName_Err=Resource Group Name is invalid. Valid characters are Alphanumeric, underscore(_) and hyphen(-), length 2-64 \
Azure_GC_Template_ResourceGroupName_Err=Resource Group Name is invalid. Valid characters are Alphanumeric, \
underscore(_) and hyphen(-), length 2-64 \
\nAvoid having - or _ as the first or last character in name.
Azure_GC_Template_Deployment_Timeout_Err=Deployment Timeout value is invalid. Should be a positive integer and more than 1200 seconds.
Azure_GC_Template_Deployment_Timeout_Err=Deployment Timeout value is invalid. Should be a positive integer and\
more than 1200 seconds.

Azure_GC_Template_Val_Profile_Err=Failed to validate the Azure profile. Verify the subscription Id, client Id and secret, OAUth 2.0 Token Endpoint and the URL information.
Azure_GC_Template_max_VM_Err=The current number of virtual machines in this Azure subscription is {0}, which is more than or equal to the default value {1} \
\n.Consider increasing Max Virtual Machines Limit value or delete existing virtual machines from your subscription.
Azure_GC_Template_Val_Profile_Err=Failed to validate the Azure profile. Verify the subscription Id, client Id and\
secret, OAUth 2.0 Token Endpoint and the URL information.
Azure_GC_Template_max_VM_Err=The current number of virtual machines in this Azure subscription is {0},\
which is more than or equal to the default value {1} \
\n.Consider increasing Max Virtual Machines Limit value or delete existing\
virtual machines from your subscription.
Azure_GC_Template_Null_Or_Empty=The template name is null or empty.
Azure_GC_Template_Name_Not_Valid=The template name is not valid. Must begin with a letter, and contain only lowercase letters, numbers, or dashes
Azure_GC_Template_Name_Not_Valid=The template name is not valid. Must begin with a letter, and \
contain only lowercase letters, numbers, or dashes
Azure_GC_Template_Name_Shortened=The template name is valid, but VM names will be shortened to: {0}
Azure_GC_Template_Name_Reserved=The template name is using reserved words: login, microsoft, windows, xbox.
Azure_GC_Template_LOC_Not_Found=The location is not valid
Azure_GC_Template_Name_LOC_No_Match=The cloud service location and the location selected do not match. Use a different template or location.
Azure_GC_Template_Name_LOC_No_Match=The cloud service location and the location selected do not match. \
Use a different template or location.
Azure_GC_Template_CS_NA=Cloud service name {0} is either not available or not valid. Use a different cloud service name.
Azure_GC_Template_CS_LOC_No_Match=The cloud service location and the location selected do not match. Use a different cloud service or location.
Azure_GC_Template_SA_Not_Valid=The storage account name is not valid, a valid name can contain only lowercase letters and numbers, and must between 3 and 24 characters.
Azure_GC_Template_CS_LOC_No_Match=The cloud service location and the location selected do not match. \
Use a different cloud service or location.
Azure_GC_Template_SA_Not_Valid=The storage account name is not valid, a valid name can contain only lowercase letters \
and numbers, and must between 3 and 24 characters.
Azure_GC_Template_SA_Type_Not_Match=The chosen storage type: {0} and the existing account type: {1} do not match.
Azure_GC_Template_SA_Already_Exists=The storage account name already exists. Use a different name.
Azure_GC_Template_SA_Cant_Validate=Could not validate the storage account name.
Expand All @@ -41,17 +55,22 @@ Azure_GC_Template_RT_Null_Or_Empty=Missing retention time.
Azure_GC_Template_RT_Not_Positive=The retention time must be a positive integer.
Azure_GC_Template_ImageFamilyOrID_Null_Or_Empty=Missing image family or image ID.
Azure_GC_Template_ImageURI_Not_Valid=Failed to validate the provided image location.
Azure_GC_Template_ImageURI_Wrong_Storage_Account=The reference image should be in the same storage account as the one declared in the template.
Azure_GC_Template_ImageURI_Wrong_Storage_Account=The reference image should be in the same storage account as the one \
declared in the template.
Azure_GC_Template_ImageReference_Not_Valid=Failed to validate the provided image reference: {0}
Azure_GC_Template_ImageID_Not_Valid=The provided Image ID does not exist
Azure_GC_Template_Gallery_Image_Not_Found=The target gallery image does not exist
Azure_GC_Template_ImageURI_Not_In_Same_Account=The image URI is not located in the same storage account as the target storage account for the VM
Azure_GC_Template_ImageURI_Not_In_Same_Account=The image URI is not located in the same storage account as the target \
storage account for the VM
Azure_GC_Template_JNLP_Not_Supported=The JNLP launch method is supported only for Windows.
Azure_GC_Template_UN_Null_Or_Empty=Missing admin user name.
Azure_GC_Template_PWD_Null_Or_Empty=Missing admin password.
Azure_GC_Template_PWD_Not_Valid=Required: Not a valid password. The password length must be between 12 and 123 characters. It also needs to have at least one digit, one lowercase, one uppercase letter and one special character ( @#$%^&*-_!+=[]'{}'|\\:`,.?/~\"();\' ).
Azure_GC_Template_PWD_Not_Valid=Required: Not a valid password. The password length must be between 12 and 123 \
characters. It also needs to have at least one digit, one lowercase, one uppercase letter and one \
special character ( @#$%^&*-_!+=[]'{}'|\\:`,.?/~\"();\' ).
Azure_GC_Template_VirtualNetwork_Null_Or_Empty=Missing virtual network name.
Azure_GC_Template_VirtualNetwork_NotFound=The virtual network {0} does not exist in the resource group {1} in this subscription.
Azure_GC_Template_VirtualNetwork_NotFound=The virtual network {0} does not exist in the resource group {1} \
in this subscription.
Azure_GC_Template_subnet_Empty=The subnet name cannot be empty
Azure_GC_Template_subnet_NotFound=The subnet {0} does not belong to the specified virtual network.
Azure_GC_Template_BuiltIn_Not_Valid=Azure build-in image is not valid.
Expand All @@ -62,9 +81,11 @@ Failed_Initial_Shutdown_Or_Delete=Node failed initial shutdown/deletion. Markin
Idle_Timeout_Shutdown=Node is being stopped(Deallocated) by Jenkins after idle timeout
Idle_Timeout_Delete=Node is being deleted by Jenkins after idle timeout
User_Delete=Node is being deleted by the user
Agent_Failed_To_Connect=The agent failed to connect. The node has been marked for deletion. Make sure that the appropriate firewall exceptions have been configured \
Agent_Failed_To_Connect=The agent failed to connect. The node has been marked for deletion. \
Make sure that the appropriate firewall exceptions have been configured \
for the agent to connect to the controller.
Agent_Failed_Init_Script=The agent connected, but failed its initialization script. The node has been marked for deletion.
Agent_Failed_Init_Script=The agent connected, but failed its initialization script. \
The node has been marked for deletion.
Shutdown_Agent_Failed_To_Revive=The previously shut down agent failed to start.

# Post build action for deprovisioning
Expand Down

0 comments on commit 1c1f794

Please sign in to comment.