-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add CD build pipeline #1
Merged
Merged
Changes from 40 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
2313ce1
prepare POM for publishing to maven central
9391b8d
add sonatype snapshots
9bbe315
add maven settings containing env variable key names, and codesigning…
9b186d3
add sonatype staging plugin
6e8511f
fix typo
22e401c
remove need for apache commons-codec and hadoop writable
8f7f76b
dont inhert from liveramp commons pom
3bb5dc1
add travis deploy instructions
740f0da
fix typo
de375a1
add necessary plugins and profiles for release
30a81ed
add WIP deploy script for importing secrets and deploying artifacts
b5471c9
make cd/deploy.sh executable
f6b003e
use absolute paths in deploy script
6892f6d
bump test error bound to 2.5%
85e1ad2
fix linting errors
7c4b24b
disable failing over lint
37dec58
skip tests when deploying since we already run tests during the build…
614e53a
fix linting issues
448da29
fix lint
0053466
add escaped secret
2b1e4da
remove empty <p> tags
50344c3
remove doclint disable profile and encrypted travis key
efc4a46
verbose maven output
2dc564d
remove whitespace
726aaa6
fix snapshot repository IDs
6a7daa9
Make publishing part of main build script.
31f8af0
don't print debug output when deploying
2041204
add comments for readability
1dd6844
move test dir to default maven dir
e4157db
package instead of install during build
22acde0
use env gpg cert instead of encrypted cert file
3abe674
remove Writable reference from README
49b4a12
formatting
d68ab58
formatting
00c9ffc
move tests to correct dir
d6eb021
formatting
e31ca89
add comments explaining use of shading plugin
3d12c2c
add echo statements for debugging
67704d0
delete encrypted cert
8c3160b
explicitly specify mvn settings dir
6e6c99d
Merge branch 'master' of github.com:LiveRamp/HyperMinHash-java into p…
34ea4e9
fix conflict
349a20b
fix tests
61ae497
only upload to sonatype if we're on master
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
language: java | ||
jdk: oraclejdk8 | ||
jdk: oraclejdk8 | ||
|
||
# Since Maven installs deps, skip the install phase since it doesn't really apply. | ||
# This just runs the command "true" in the install phase which doesn't do much of anything. | ||
install: true | ||
|
||
script: | ||
# First install any deps and runs tests | ||
- mvn clean package test -P-build-src-and-docs -B -V | ||
# If successful, run the deploy script to publish produced artifacts | ||
- ./cd/deploy.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /usr/bin/env bash | ||
|
||
# TODO comment this back in | ||
#if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then | ||
CERT_DIR="${TRAVIS_BUILD_DIR}/cd/codesigning.asc" | ||
echo "Set certificate directory to ${CERT_DIR}" | ||
|
||
# This block unencrypts GPG signing keys and imports them into the build environment so they | ||
# can be used to sign artifacts produced by this build. | ||
|
||
# If any of these commands fail, exit so we get quick feedback from the build. | ||
set -e | ||
|
||
# The cert is stored as base64 to prevent interpretation issues in bash, so decode it and store | ||
# it to the cert directory. | ||
echo "${GPG_CERT_BASE64}" | base64 --decode -i - > "${CERT_DIR}" | ||
echo "Saved GPG cert to file" | ||
|
||
# Remove the unencrypted cert file inside a trap. This way, we'll always remove the cert even if | ||
# if the script fails. | ||
trap "rm ${CERT_DIR}; echo 'Removed cert file'; " EXIT | ||
|
||
# import these certs into GPG | ||
gpg --fast-import "${CERT_DIR}" | ||
echo "Imported certs into GPG" | ||
|
||
# Run the deploy phase (which will sign any artifacts). The build will use the GPG certs we | ||
# imported above | ||
mvn deploy -P sign,build-src-and-docs -DskipTests=true --settings "${TRAVIS_BUILD_DIR}/cd/mvnsettings.xml" | ||
#fi TODO comment back in | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | ||
https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<servers> | ||
<server> | ||
<!-- In order for these credentials to be used for the desired repository/server, the ID | ||
specified here must match the ID of the repositories specified in the distributionManagement | ||
or repositories tags. --> | ||
<id>ossrh</id> | ||
<username>${env.OSSRH_JIRA_USERNAME}</username> | ||
<password>${env.OSSRH_JIRA_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
|
||
<profiles> | ||
<profile> | ||
<id>ossrh</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<properties> | ||
<gpg.executable>gpg</gpg.executable> | ||
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname> | ||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</settings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="http://maven.apache.org/POM/4.0.0" | ||
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.liveramp</groupId> | ||
<artifactId>hyperminhash</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<version>0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>com.liveramp</groupId> | ||
<artifactId>pom-common</artifactId> | ||
<version>1.1-SNAPSHOT</version> | ||
</parent> | ||
<name>${project.groupId}:${project.artifactId}</name> | ||
<description> | ||
HyperMinHash is a probabilistic data structure that can approximate union, intersection, and set | ||
cardinalities as well as Jaccard indices of very large sets with high accuracy, in loglog space, | ||
and in a streaming fashion. | ||
</description> | ||
<url>www.github.com/LiveRamp/HyperMinHash-java</url> | ||
|
||
<organization> | ||
<name>LiveRamp</name> | ||
<url>www.liveramp.com</url> | ||
</organization> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache 2</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<scm> | ||
<connection>scm:git:git@github.com:LiveRamp/HyperMinHash-java.git</connection> | ||
|
@@ -19,72 +37,200 @@ | |
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<issueManagement> | ||
<system>Github</system> | ||
<url>www.github.com/LiveRamp/HyperMinHash-java</url> | ||
</issueManagement> | ||
|
||
<developers> | ||
<developer> | ||
<name>Christian Hansen</name> | ||
<email>christianhshansen@gmail.com</email> | ||
<organization>LiveRamp</organization> | ||
<organizationUrl>www.liveramp.com</organizationUrl> | ||
</developer> | ||
<developer> | ||
<name>Harry Rackmil</name> | ||
<email>harryrackmil@gmail.com</email> | ||
<organization>LiveRamp</organization> | ||
<organizationUrl>www.liveramp.com</organizationUrl> | ||
</developer> | ||
<developer> | ||
<name>Shrif Nada</name> | ||
<email>snadalive@gmail.com</email> | ||
<organization>LiveRamp</organization> | ||
<organizationUrl>www.liveramp.com</organizationUrl> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<skip.tests>false</skip.tests> | ||
<hadoop.version>2.5.0</hadoop.version> | ||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Used to pin the compiler to JDK 1.8 --> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.3.2</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- | ||
Used to publish artifacts produced by this project to Sonatype (which is mirrored to | ||
Maven Central). | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<version>1.6.8</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<finalName>uber-${artifactId}-${version}</finalName> | ||
<serverId>ossrh</serverId> | ||
<nexusUrl>https://oss.sonatype.org/</nexusUrl> | ||
<autoReleaseAfterClose>true</autoReleaseAfterClose> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<!-- Used to sign artifacts with our GPG key, as required by Sona Type. --> | ||
<profile> | ||
<id>sign</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<version>1.6</version> | ||
<executions> | ||
<execution> | ||
<id>sign-artifacts</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
<!-- If testing releases with hardcoded values in your settings.xml file, uncomment | ||
this setting to make GPG read those hardcoded literals --> | ||
<!--<configuration>--> | ||
<!--<gpgArguments>--> | ||
<!--<arg>--pinentry-mode</arg>--> | ||
<!--<arg>loopback</arg>--> | ||
<!--</gpgArguments>--> | ||
<!--</configuration>--> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<!-- Used to generate a stand-alone JAR which includes all dependencies. Note that even though | ||
we're using the shading plugin, we're not actually renaming any dependencies. We're only | ||
using the shading plugin's capability to create an uber jar. --> | ||
<profile> | ||
<id>uberjar</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we just uber-jarring here, or is there actual shading needed? Can we have comment explaining this? |
||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<finalName>uber-${artifactId}-${version}</finalName> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
|
||
<!-- Used to package the Javadocs and sourcecode for this project --> | ||
<profile> | ||
<id>build-src-and-docs</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
|
||
<build> | ||
|
||
<plugins> | ||
<!-- Used to build a JAR containing the source code from this project --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.4</version> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<!-- Used to generate javadocs for this project --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.10.4</version> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
</profile> | ||
</profiles> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.hadoop</groupId> | ||
<artifactId>hadoop-common</artifactId> | ||
<version>${hadoop.version}</version> | ||
</dependency> | ||
<!-- Use metrohash for convenient & fast 128 bit hashing functions --> | ||
<dependency> | ||
<groupId>com.adgear</groupId> | ||
<artifactId>metrohash</artifactId> | ||
<version>1.0.0</version> | ||
</dependency> | ||
|
||
<!-- Use Junit even though our code has no bugs ;) --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<repositories> | ||
<repository> | ||
<id>conjars.org</id> | ||
<name>Conjars</name> | ||
<url>http://conjars.org/repo</url> | ||
</repository> | ||
<distributionManagement> | ||
|
||
<snapshotRepository> | ||
<id>ossrh</id> | ||
<url>https://oss.sonatype.org/content/repositories/snapshots</url> | ||
</snapshotRepository> | ||
|
||
<repository> | ||
<id>liveramp-repositories</id> | ||
<name>Liveramp Repositories</name> | ||
<url>http://repository.liveramp.com/artifactory/liveramp-repositories</url> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
<updatePolicy>always</updatePolicy> | ||
</snapshots> | ||
<id>ossrh</id> | ||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>sonatype-releases</id> | ||
<url>http://oss.sonatype.org/content/repositories/releases</url> | ||
</pluginRepository> | ||
<pluginRepository> | ||
<id>clojars.org</id> | ||
<url>http://clojars.org/repo</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
|
||
</distributionManagement> | ||
</project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment this back in?