-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Trent Mohay
committed
Feb 25, 2020
0 parents
commit d5d7c35
Showing
26 changed files
with
2,347 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,200 @@ | ||
--- | ||
version: 2.1 | ||
|
||
orbs: | ||
slack: circleci/slack@3.4.1 | ||
|
||
executors: | ||
executor_med: # 2cpu, 4G ram | ||
docker: | ||
- image: circleci/openjdk:11.0.4-jdk-stretch | ||
resource_class: medium | ||
working_directory: ~/project | ||
environment: | ||
JAVA_TOOL_OPTIONS: -Xmx2048m | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 -Xmx2048m | ||
|
||
executor_large: # 4cpu, 8G ram | ||
docker: | ||
- image: circleci/openjdk:11.0.4-jdk-stretch | ||
resource_class: large | ||
working_directory: ~/project | ||
environment: | ||
JAVA_TOOL_OPTIONS: -Xmx4096m | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4 -Xmx4096m | ||
|
||
executor_machine: # 2cpu , 8G ram | ||
machine: | ||
image: ubuntu-1604:201903-01 #Ubuntu 16.04, docker 18.09.3, docker-compose 1.23.1 | ||
docker_layer_caching: true | ||
working_directory: ~/project | ||
environment: | ||
JAVA_TOOL_OPTIONS: -Xmx4096m | ||
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 -Xmx4096m | ||
|
||
commands: | ||
prepare: | ||
description: "Prepare" | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restore cached gradle dependencies | ||
keys: | ||
- deps-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }} | ||
- deps-{{ checksum "build.gradle" }} | ||
- deps- | ||
|
||
capture_test_results: | ||
description: "Capture test results" | ||
steps: | ||
- run: | ||
name: Gather test results | ||
when: always | ||
command: | | ||
FILES=`find . -name test-results` | ||
for FILE in $FILES | ||
do | ||
MODULE=`echo "$FILE" | sed -e 's@./\(.*\)/build/test-results@\1@'` | ||
TARGET="build/test-results/$MODULE" | ||
mkdir -p "$TARGET" | ||
cp -rf ${FILE}/*/* "$TARGET" | ||
done | ||
- store_test_results: | ||
path: build/test-results | ||
|
||
notify: | ||
description: "Notify Slack" | ||
steps: | ||
- slack/status: | ||
fail_only: true | ||
only_for_branches: 'master' | ||
|
||
jobs: | ||
build: | ||
executor: executor_large | ||
steps: | ||
- prepare | ||
- run: | ||
name: Build | ||
command: | | ||
./gradlew --no-daemon --parallel build | ||
- run: | ||
name: Test | ||
no_output_timeout: 20m | ||
command: | | ||
./gradlew --no-daemon --parallel test | ||
- run: | ||
name: Integration Test | ||
no_output_timeout: 20m | ||
command: | | ||
./gradlew --no-daemon --parallel integrationTest --info | ||
- notify | ||
- capture_test_results | ||
- save_cache: | ||
name: Caching gradle dependencies | ||
key: deps-{{ checksum "build.gradle" }}-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- .gradle | ||
- ~/.gradle | ||
- persist_to_workspace: | ||
root: ~/project | ||
paths: | ||
- ./ | ||
|
||
acceptanceTests: | ||
executor: executor_machine | ||
steps: | ||
- prepare | ||
- run: | ||
name: Install Packages - Java 11 | ||
command: | | ||
sudo add-apt-repository -y ppa:openjdk-r/ppa | ||
sudo apt update | ||
sudo apt install -y openjdk-11-jdk | ||
sudo update-java-alternatives -s java-1.11.0-openjdk-amd64 | ||
- run: | ||
name: Acceptance Test | ||
no_output_timeout: 20m | ||
command: | | ||
./gradlew --no-daemon --parallel acceptanceTest | ||
- notify | ||
- capture_test_results | ||
|
||
buildDocker: | ||
executor: executor_med | ||
steps: | ||
- prepare | ||
- setup_remote_docker | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: hadoLint | ||
command: | | ||
docker run --rm -i hadolint/hadolint < docker/Dockerfile | ||
- run: | ||
name: build image | ||
command: | | ||
./gradlew --no-daemon distDocker | ||
- run: | ||
name: test image | ||
command: | | ||
mkdir -p docker/reports | ||
./gradlew --no-daemon testDocker | ||
- notify | ||
|
||
publish: | ||
executor: executor_med | ||
steps: | ||
- prepare | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: Publish | ||
command: | | ||
./gradlew --no-daemon --parallel bintrayUpload | ||
- notify | ||
|
||
publishDocker: | ||
executor: executor_med | ||
steps: | ||
- prepare | ||
- setup_remote_docker | ||
- attach_workspace: | ||
at: ~/project | ||
- run: | ||
name: Publish Docker | ||
command: | | ||
docker login --username "${DOCKER_USER}" --password "${DOCKER_PASSWORD}" | ||
./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH}" dockerUpload | ||
- notify | ||
|
||
workflows: | ||
version: 2 | ||
default: | ||
jobs: | ||
- build | ||
- acceptanceTests: | ||
requires: | ||
- build | ||
- buildDocker: | ||
requires: | ||
- build | ||
- publish: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- /^release-.*/ | ||
requires: | ||
- build | ||
- acceptanceTests | ||
- publishDocker: | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- /^release-.*/ | ||
requires: | ||
- build | ||
- acceptanceTests | ||
- buildDocker |
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,28 @@ | ||
*.bak | ||
*.swp | ||
*.tmp | ||
*~.nib | ||
*.iml | ||
*.launch | ||
*.swp | ||
*.log | ||
.classpath | ||
.DS_Store | ||
.externalToolBuilders/ | ||
.gradle/ | ||
.idea/ | ||
.loadpath | ||
.metadata | ||
.prefs | ||
.project | ||
.recommenders/ | ||
.settings | ||
.springBeans | ||
.vertx | ||
bin/ | ||
local.properties | ||
target/ | ||
tmp/ | ||
build/ | ||
out/ | ||
docker/reports/* |
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,18 @@ | ||
Sign the CLA | ||
============= | ||
|
||
This page is the step-by-step guide to signing the Consensys AG | ||
Individual Contributor License Agreement. | ||
|
||
1. First and foremost, read [the current version of the CLA]. | ||
It is written to be as close to plain English as possible. | ||
|
||
2. Make an account on [GitHub] if you don't already have one. | ||
|
||
3. After creating your first pull request, you will see a merge | ||
pre-requisite requiring to you read and sign the CLA. | ||
|
||
If you have any questions, you can reach us on [Gitter]. | ||
|
||
[GitHub]: https://github.com/ | ||
[the current version of the CLA]: https://gist.github.com/rojotek/978b48a5e8b68836856a8961d6887992 |
Oops, something went wrong.