Skip to content

Commit 31b9c29

Browse files
authored
Refresh plugin for 2023 (#382)
1 parent 45d024f commit 31b9c29

10 files changed

Lines changed: 39 additions & 43 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/release-drafter.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/renovate.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base",
5+
":semanticCommitsDisabled"
6+
],
7+
"automerge": true,
8+
"labels": [
9+
"dependencies"
10+
],
11+
"rebaseWhen": "conflicted"
12+
}

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<extension>
33
<groupId>io.jenkins.tools.incrementals</groupId>
44
<artifactId>git-changelist-maven-extension</artifactId>
5-
<version>1.2</version>
5+
<version>1.5</version>
66
</extension>
77
</extensions>

Jenkinsfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
#!/usr/bin/env groovy
2-
3-
4-
/* `buildPlugin` step provided by: https://github.com/jenkins-infra/pipeline-library */
5-
buildPlugin(useContainerAgent: true, platforms: ['linux'])
1+
/*
2+
See the documentation for more options:
3+
https://github.com/jenkins-infra/pipeline-library/
4+
*/
5+
buildPlugin(
6+
useContainerAgent: true,
7+
configurations: [
8+
[platform: 'linux', jdk: 17],
9+
[platform: 'linux', jdk: 11],
10+
])

pom.xml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.jenkins-ci.plugins</groupId>
77
<artifactId>plugin</artifactId>
8-
<version>4.29</version>
8+
<version>4.55</version>
99
</parent>
1010

1111
<artifactId>azure-vm-agents</artifactId>
@@ -36,21 +36,16 @@
3636
</developers>
3737

3838
<scm>
39-
<connection>scm:git:ssh://git@github.com/${gitHubRepo}.git</connection>
40-
<developerConnection>scm:git:ssh://git@github.com/${gitHubRepo}.git</developerConnection>
39+
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
40+
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
4141
<url>https://github.com/${gitHubRepo}</url>
4242
<tag>${scmTag}</tag>
4343
</scm>
4444

4545
<properties>
4646
<changelist>9999-SNAPSHOT</changelist>
4747
<gitHubRepo>jenkinsci/azure-vm-agents-plugin</gitHubRepo>
48-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49-
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
50-
<jenkins.version>2.277.2</jenkins.version>
51-
<java.level>8</java.level>
52-
<findbugs.failOnError>true</findbugs.failOnError>
53-
<findbugs.excludeFilterFile>findbugs-exclude.xml</findbugs.excludeFilterFile>
48+
<jenkins.version>2.361.4</jenkins.version>
5449
<maven.javadoc.skip>true</maven.javadoc.skip>
5550
<azure-credentials.version>198.vf9c2fdfde55c</azure-credentials.version>
5651
</properties>
@@ -59,8 +54,8 @@
5954
<dependencies>
6055
<dependency>
6156
<groupId>io.jenkins.tools.bom</groupId>
62-
<artifactId>bom-2.277.x</artifactId>
63-
<version>966.v3857b7c82032</version>
57+
<artifactId>bom-2.361.x</artifactId>
58+
<version>1883.vcb_768a_7c3610</version>
6459
<scope>import</scope>
6560
<type>pom</type>
6661
</dependency>
@@ -71,7 +66,7 @@
7166
<dependency>
7267
<groupId>io.jenkins.plugins</groupId>
7368
<artifactId>azure-sdk</artifactId>
74-
<version>55.v31806ceca163</version>
69+
<version>118.v43f74dd9ca_dc</version>
7570
</dependency>
7671
<dependency>
7772
<groupId>org.jenkins-ci.plugins</groupId>
@@ -81,7 +76,7 @@
8176
<dependency>
8277
<groupId>org.jenkins-ci.plugins</groupId>
8378
<artifactId>jsch</artifactId>
84-
<version>0.1.55.2</version>
79+
<version>0.1.55.61.va_e9ee26616e7</version>
8580
</dependency>
8681
<dependency>
8782
<groupId>org.mockito</groupId>

src/main/java/com/microsoft/azure/vmagent/AzureVMAgentCleanUpTask.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,9 @@ public void cleanDeployments(long successTimeoutInMinutes, long failTimeoutInMin
223223
// being accepted by Azure.
224224
// To avoid this, we implement a retry. If we hit an exception, we will decrement the number
225225
// of retries. If we hit 0, we remove the deployment from our list.
226-
Deployment deployment;
227-
try {
228-
deployment = azureClient.deployments().
229-
getByResourceGroup(info.getResourceGroupName(), info.getDeploymentName());
230-
} catch (NullPointerException e) {
231-
LOGGER.log(getNormalLoggingLevel(), "Deployment " + info.getDeploymentName()
232-
+ " not found, skipping");
233-
continue;
234-
}
226+
Deployment deployment = azureClient.deployments().
227+
getByResourceGroup(info.getResourceGroupName(), info.getDeploymentName());
228+
235229
if (deployment == null) {
236230
LOGGER.log(getNormalLoggingLevel(), "Deployment " + info.getDeploymentName()
237231
+ " not found, skipping");

src/main/java/com/microsoft/azure/vmagent/AzureVMAgentTemplate.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,9 +1560,6 @@ public ListBoxModel doFillExistingStorageAccountNameItems(
15601560
model.add(storageAccount.name());
15611561
}
15621562
}
1563-
1564-
} catch (NullPointerException e) {
1565-
// Do nothing
15661563
} catch (Exception e) {
15671564
LOGGER.log(Level.WARNING, "Cannot list storage account: ", e);
15681565
}

src/main/java/com/microsoft/azure/vmagent/AzureVMCloud.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,12 +1073,12 @@ public static void addLogRecorder(Jenkins h) throws IOException {
10731073
return;
10741074
}
10751075
LogRecorderManager manager = h.getLog();
1076-
Map<String, LogRecorder> logRecorders = manager.logRecorders;
1077-
if (!logRecorders.containsKey(LOG_RECORDER_NAME)) {
1078-
LogRecorder recorder = new LogRecorder(LOG_RECORDER_NAME);
1076+
LogRecorder recorder = new LogRecorder(LOG_RECORDER_NAME);
1077+
List<LogRecorder> logRecorders = manager.getRecorders();
1078+
if (!logRecorders.contains(recorder)) {
10791079
String packageName = AzureVMAgent.class.getPackage().getName();
1080-
recorder.targets.add(new LogRecorder.Target(packageName, Level.WARNING));
1081-
logRecorders.put(LOG_RECORDER_NAME, recorder);
1080+
recorder.getLoggers().add(new LogRecorder.Target(packageName, Level.WARNING));
1081+
logRecorders.add(recorder);
10821082
recorder.save();
10831083
}
10841084
}

0 commit comments

Comments
 (0)