Skip to content

Commit e8b7068

Browse files
committed
Migrate to Circle CI v2
Our setup doesn't seem to be working with JDK 9 yet (fails with `Fatal error compiling: java.lang.NoClassDefFoundError: javax/annotation/Generated: javax.annotation.Generated`). Leaving it out for now, since the old setup only used JDK 8. Circle doesn't support wildcard checksums very well, and since we have multiple `pom.xml` files, I've skipped caching dependencies for now.
1 parent 2770c59 commit e8b7068

4 files changed

Lines changed: 42 additions & 36 deletions

File tree

.buildscript/deploy_snapshot.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
# Adapted from https://coderwall.com/p/9b_lfq and
66
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/
77

8-
SLUG="segmentio/analytics-java"
8+
REPO="analytics-java"
9+
USERNAME="segmentio"
910
JDK="oraclejdk8"
1011
BRANCH="master"
1112

12-
set -e
13-
14-
if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
15-
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
16-
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
17-
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
18-
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
19-
echo "Skipping snapshot deployment: was pull request."
20-
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
21-
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
13+
if [ "$CIRCLE_PROJECT_REPONAME" != "$REPO" ]; then
14+
echo "Skipping snapshot deployment: wrong repository. Expected '$REPO' but was '$CIRCLE_PROJECT_REPONAME'."
15+
elif [ "$CIRCLE_PROJECT_USERNAME" != "$USERNAME" ]; then
16+
echo "Skipping snapshot deployment: wrong owner. Expected '$USERNAME' but was '$CIRCLE_PROJECT_USERNAME'."
17+
elif [ "$CIRCLE_JDK_VERSION" != "$JDK" ]; then
18+
# $CIRCLE_JDK_VERSION must be manually set in circle.yml
19+
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$CIRCLE_JDK_VERSION'."
20+
elif [ "$CIRCLE_BRANCH" != "$BRANCH" ]; then
21+
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$CIRCLE_BRANCH'."
2222
else
2323
echo "Deploying snapshot..."
2424
mvn clean source:jar javadoc:jar deploy --settings=".buildscript/settings.xml" -Dmaven.test.skip=true

.circleci/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ci:
2+
mvn package -B
3+
.buildscript/deploy_snapshot.sh
4+
5+
.PHONY: ci

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
jobs:
3+
build-jdklatest:
4+
docker:
5+
- image: circleci/openjdk
6+
working_directory: ~/analytics-java
7+
steps:
8+
- checkout
9+
- run: mvn package -B
10+
build-jdk8:
11+
docker:
12+
- image: circleci/openjdk:8-jdk-browsers
13+
working_directory: ~/analytics-java
14+
environment:
15+
CIRCLE_JDK_VERSION: oraclejdk8
16+
steps:
17+
- checkout
18+
- run: mvn package -B
19+
- run: .buildscript/deploy_snapshot.sh
20+
21+
workflows:
22+
version: 2
23+
build:
24+
jobs:
25+
- build-jdklatest
26+
- build-jdk8

.travis.yml

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

0 commit comments

Comments
 (0)