Skip to content

Instantly share code, notes, and snippets.

@parj
Created May 19, 2019 10:50
Show Gist options
  • Save parj/077c4df9f72b651f66ea15f8de5b3225 to your computer and use it in GitHub Desktop.
Save parj/077c4df9f72b651f66ea15f8de5b3225 to your computer and use it in GitHub Desktop.
CircleCI continuous CI job
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:11-jdk
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/repo-11
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: mvn dependency:go-offline
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}
- run:
name: Add GPG key
command: .travis/importKeys.sh
- setup_remote_docker:
docker_layer_caching: true
# run tests!
- run: .travis/build.sh
- run:
name: Save test results
command: |
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
when: always
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results/junit
- run:
name: Push docker image
command: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
mvn docker:push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment