Skip to content

Commit

Permalink
Merge pull request #16 from jglick/Jenkinsfile
Browse files Browse the repository at this point in the history
Jenkinsfile
  • Loading branch information
jglick authored Apr 16, 2019
2 parents 35f96f2 + e01b5fc commit 36a658c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Builds a module using https://github.com/jenkins-infra/pipeline-library
buildPlugin(configurations: buildPlugin.recommendedConfigurations())
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.36</version>
<version>3.42</version>
<relativePath />
</parent>

<groupId>org.jenkins-ci.modules</groupId>
Expand All @@ -18,13 +19,14 @@
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/mit-license.php</url>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

<scm>
<connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-module.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/${project.artifactId}-module.git</developerConnection>
<url>https://github.com/jenkinsci/${project.artifactId}-module</url>
<tag>HEAD</tag>
</scm>

Expand All @@ -33,6 +35,19 @@
<java.level>8</java.level>
</properties>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>io.github.stephenc.crypto</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
Expand Down Expand Up @@ -71,7 +70,7 @@ public InstanceIdentity(File keyFile) throws IOException {
}
}

private static KeyPair read(File keyFile, File oldKeyFile, KeyPairGenerator gen) throws IOException {
private KeyPair read(File keyFile, File oldKeyFile, KeyPairGenerator gen) throws IOException {
byte[] enc;
KeyPair keyPair = null;

Expand All @@ -95,7 +94,7 @@ private static KeyPair read(File keyFile, File oldKeyFile, KeyPairGenerator gen)
return keyPair;
}

private static void write(KeyPair keys, File keyFile) throws IOException {
private void write(KeyPair keys, File keyFile) throws IOException {
String pem = PEMHelper.encodePEM(keys);
OutputStream os = new FileOutputStream(keyFile);
try {
Expand All @@ -109,7 +108,7 @@ private static void write(KeyPair keys, File keyFile) throws IOException {
}

// Would be neater to actually write an encrypted RSA key in PEM format, but could not wrangle BouncyCastle into reading the result, so just doing generic encryption instead:
private static final CryptoConfidentialKey KEY = new CryptoConfidentialKey(InstanceIdentity.class, "KEY");
private final CryptoConfidentialKey KEY = new CryptoConfidentialKey(InstanceIdentity.class, "KEY");

/**
* Try to make the key read-only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void testCompareReadPKCS1AndPCKS8() throws Exception {

private static String unifyEOL(String s) {
// unify EOL for comparison purposes
return s.replaceAll("(\r|\n)", "\n");
return s.replaceAll("\r\n", "\n");
}

}

0 comments on commit 36a658c

Please sign in to comment.