Skip to content

Commit 558b2e0

Browse files
Merge pull request #1 from jcustenborder/jenkins
Added build logic to create and upload releases to github
2 parents a4c3d33 + 455370e commit 558b2e0

File tree

9 files changed

+167
-22
lines changed

9 files changed

+167
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# Created by .ignore support plugin (hsz.mobi)
2+
target/

Jenkinsfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!groovy
2+
node {
3+
def mvnBuildNumber = "0.1.${env.BUILD_NUMBER}"
4+
5+
def mvnHome = tool 'M3'
6+
7+
checkout scm
8+
9+
if (env.BRANCH_NAME == 'master') {
10+
stage 'versioning'
11+
sh "${mvnHome}/bin/mvn -B versions:set -DgenerateBackupPoms=false -DnewVersion=${mvnBuildNumber}"
12+
}
13+
14+
stage 'build'
15+
sh "${mvnHome}/bin/mvn -B -P maven-central clean verify package"
16+
17+
junit '**/target/surefire-reports/TEST-*.xml'
18+
19+
if (env.BRANCH_NAME == 'master') {
20+
stage 'publishing'
21+
sh "${mvnHome}/bin/mvn -B -P github,maven-central deploy"
22+
}
23+
}

bin/suspend.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ else
2525
exit 1
2626
fi
2727

28-
export CLASSPATH="$(find `pwd`/target/kafka-connect-salesforce-1.0-SNAPSHOT-package/share/java/ -type f -name '*.jar' | tr '\n' ':')"
28+
export CLASSPATH="$(find target/ -type f -name '*.jar'| grep '\-package' | tr '\n' ':')"
2929
export KAFKA_JMX_OPTS='-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'
3030

3131
$CONFLUENT_HOME/bin/connect-standalone connect/connect-avro-docker.properties config/salesforce.properties

pom.xml

Lines changed: 125 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,36 @@
2626

2727
<name>kafka-connect-splunk</name>
2828

29+
<url>https://github.com/jcustenborder/kafka-connect-splunk</url>
30+
31+
<licenses>
32+
<license>
33+
<name>The Apache License, Version 2.0</name>
34+
<url>https://www.apache.org/licenses/LICENSE-2.0</url>
35+
<distribution>repo</distribution>
36+
</license>
37+
</licenses>
38+
39+
<developers>
40+
<developer>
41+
<id>jcustenborder</id>
42+
<name>Jeremy Custenborder</name>
43+
<email>jcustenborder@gmail.com</email>
44+
<timezone>America/Chicago</timezone>
45+
</developer>
46+
</developers>
47+
48+
<scm>
49+
<url>https://github.com/jcustenborder/kafka-connect-splunk</url>
50+
<connection>scm:git:https://github.com/jcustenborder/kafka-connect-splunk.git</connection>
51+
<developerConnection>scm:git:git://git@github.com:jcustenborder/kafka-connect-splunk.git</developerConnection>
52+
</scm>
53+
54+
<issueManagement>
55+
<url>https://github.com/jcustenborder/kafka-connect-splunk/issues</url>
56+
<system>github</system>
57+
</issueManagement>
58+
2959
<properties>
3060
<kafka.version>0.10.0.0-cp1</kafka.version>
3161
<junit.version>4.12</junit.version>
@@ -72,11 +102,6 @@
72102
<artifactId>google-http-client-jackson2</artifactId>
73103
<version>1.22.0</version>
74104
</dependency>
75-
<dependency>
76-
<groupId>com.google.oauth-client</groupId>
77-
<artifactId>google-oauth-client-jetty</artifactId>
78-
<version>1.22.0</version>
79-
</dependency>
80105
<dependency>
81106
<groupId>org.eclipse.jetty</groupId>
82107
<artifactId>jetty-util</artifactId>
@@ -214,6 +239,101 @@
214239
</resource>
215240
</resources>
216241
</build>
242+
<profiles>
243+
<profile>
244+
<id>github</id>
245+
<build>
246+
<plugins>
247+
<plugin>
248+
<groupId>org.apache.maven.plugins</groupId>
249+
<artifactId>maven-gpg-plugin</artifactId>
250+
<version>1.6</version>
251+
<executions>
252+
<execution>
253+
<id>sign-artifacts</id>
254+
<phase>verify</phase>
255+
<goals>
256+
<goal>sign</goal>
257+
</goals>
258+
<configuration>
259+
<keyname>${gpg.keyname}</keyname>
260+
<passphraseServerId>${gpg.keyname}</passphraseServerId>
261+
</configuration>
262+
</execution>
263+
</executions>
264+
</plugin>
265+
<plugin>
266+
<groupId>de.jutzig</groupId>
267+
<artifactId>github-release-plugin</artifactId>
268+
<version>1.1.1</version>
269+
<executions>
270+
<execution>
271+
<id>deploy-to-github</id>
272+
<phase>deploy</phase>
273+
<goals>
274+
<goal>release</goal>
275+
</goals>
276+
<configuration>
277+
<description>${project.version}</description>
278+
<releaseName>${project.version}</releaseName>
279+
<tag>${project.version}</tag>
280+
281+
<!-- If your project has additional artifacts, such as ones produced by
282+
the maven-assembly-plugin, you can define the following
283+
(requires version 1.1.1 of the plugin or higher): -->
284+
<fileSets>
285+
<fileSet>
286+
<directory>${project.build.directory}</directory>
287+
<includes>
288+
<include>${project.artifactId}*.tar.gz</include>
289+
<include>${project.artifactId}*.tar.gz.asc</include>
290+
</includes>
291+
</fileSet>
292+
</fileSets>
293+
</configuration>
294+
</execution>
295+
</executions>
296+
297+
</plugin>
298+
<plugin>
299+
<groupId>org.sonatype.plugins</groupId>
300+
<artifactId>nexus-staging-maven-plugin</artifactId>
301+
<version>1.6.7</version>
302+
<extensions>true</extensions>
303+
<configuration>
304+
<!--<serverId>oss.sonatype.org</serverId>-->
305+
<!--<nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
306+
<!--<description>${project.version}</description>-->
307+
<skipRemoteStaging>true</skipRemoteStaging>
308+
<skipStaging>true</skipStaging>
309+
<skipLocalStaging>true</skipLocalStaging>
310+
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
311+
</configuration>
312+
<executions>
313+
<execution>
314+
<id>deploy-to-sonatype</id>
315+
<phase>deploy</phase>
316+
<goals>
317+
<!--<goal>deploy</goal>-->
318+
<!--<goal>release</goal>-->
319+
</goals>
320+
</execution>
321+
</executions>
322+
</plugin>
323+
</plugins>
324+
</build>
325+
<distributionManagement>
326+
<repository>
327+
<id>oss.sonatype.org</id>
328+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
329+
</repository>
330+
<snapshotRepository>
331+
<id>oss.sonatype.org</id>
332+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
333+
</snapshotRepository>
334+
</distributionManagement>
335+
</profile>
336+
</profiles>
217337
<repositories>
218338
<repository>
219339
<id>confluent</id>

src/main/assembly/package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<id>package</id>
2424
<formats>
2525
<format>dir</format>
26+
<format>tar.gz</format>
2627
</formats>
2728
<includeBaseDirectory>false</includeBaseDirectory>
2829
<fileSets>

src/main/java/io/confluent/kafka/connect/splunk/EventConverter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright (C) ${project.inceptionYear} Jeremy Custenborder (jcustenborder@gmail.com)
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

src/main/java/io/confluent/kafka/connect/splunk/SinkRecordContent.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright (C) ${project.inceptionYear} Jeremy Custenborder (jcustenborder@gmail.com)
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

src/main/java/io/confluent/kafka/connect/splunk/SplunkHttpSinkTask.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright (C) ${project.inceptionYear} Jeremy Custenborder (jcustenborder@gmail.com)
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

src/test/java/io/confluent/kafka/connect/splunk/SinkRecordContentTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
22
* Copyright (C) ${project.inceptionYear} Jeremy Custenborder (jcustenborder@gmail.com)
3-
* <p>
3+
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
7-
* <p>
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
* <p>
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
1212
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

0 commit comments

Comments
 (0)