diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c9173c5f6..5ae1dff51f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,23 +1,21 @@ --- version: 2.1 executors: - besu_executor_med: + besu_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 + GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 - besu_executor_xl: + besu_executor_xl: # 8cpu, 16G ram docker: - image: circleci/openjdk:11.0.4-jdk-stretch resource_class: xlarge working_directory: ~/project environment: - JAVA_TOOL_OPTIONS: -Xmx2048m - GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=6 -Xmx2048m + GRADLE_OPTS: -Xmx4096m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4 commands: prepare: @@ -153,6 +151,11 @@ jobs: name: build image command: | ./gradlew --no-daemon distDocker + - run: + name: test image + command: | + mkdir -p docker/reports + ./gradlew --no-daemon testDocker publish: executor: besu_executor_med diff --git a/build.gradle b/build.gradle index 1e8eb425ac..4a107f1001 100644 --- a/build.gradle +++ b/build.gradle @@ -238,7 +238,7 @@ allprojects { */ test { jvmArgs = [ - '-Xmx2g', + '-Xmx4g', '-XX:-UseGCOverheadLimit', // Mockito and jackson-databind do some strange reflection during tests. // This suppresses an illegal access warning. @@ -551,9 +551,22 @@ task distDocker(type: Exec) { args "-c", "docker build --build-arg BUILD_DATE=${buildTime()} --build-arg VERSION=${dockerBuildVersion} --build-arg VCS_REF=${getCheckedOutGitCommitHash()} -t ${image} ." } +task testDocker(type: Exec) { + dependsOn distDocker + def dockerReportsDir = "docker/reports/" + def image = project.hasProperty('release.releaseVersion') ? "hyperledger/besu:" + project.property('release.releaseVersion') : "hyperledger/besu:${project.version}" + workingDir "docker" + + doFirst { + new File(dockerReportsDir).mkdir() + } + + executable "sh" + args "-c", "bash test.sh ${image}" +} + task dockerUpload(type: Exec) { dependsOn distDocker - def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}" def imageName = "hyperledger/besu" def image = project.hasProperty('release.releaseVersion') ? "${imageName}:" + project.property('release.releaseVersion') : "${imageName}:${project.version}" def cmd = "docker push '${image}'"