updates to circle building acceptance tests (#184)

* updates to circle building acceptance tests
* added in a testDocker gradle target to test the docker image

Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
pull/182/head
Joshua Fernandes 5 years ago committed by GitHub
parent 271d578956
commit a6b2ec7460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .circleci/config.yml
  2. 17
      build.gradle

@ -1,23 +1,21 @@
--- ---
version: 2.1 version: 2.1
executors: executors:
besu_executor_med: besu_executor_med: # 2cpu, 4G ram
docker: docker:
- image: circleci/openjdk:11.0.4-jdk-stretch - image: circleci/openjdk:11.0.4-jdk-stretch
resource_class: medium resource_class: medium
working_directory: ~/project working_directory: ~/project
environment: environment:
JAVA_TOOL_OPTIONS: -Xmx2048m GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 -Xmx2048m
besu_executor_xl: besu_executor_xl: # 8cpu, 16G ram
docker: docker:
- image: circleci/openjdk:11.0.4-jdk-stretch - image: circleci/openjdk:11.0.4-jdk-stretch
resource_class: xlarge resource_class: xlarge
working_directory: ~/project working_directory: ~/project
environment: environment:
JAVA_TOOL_OPTIONS: -Xmx2048m GRADLE_OPTS: -Xmx4096m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=6 -Xmx2048m
commands: commands:
prepare: prepare:
@ -153,6 +151,11 @@ jobs:
name: build image name: build image
command: | command: |
./gradlew --no-daemon distDocker ./gradlew --no-daemon distDocker
- run:
name: test image
command: |
mkdir -p docker/reports
./gradlew --no-daemon testDocker
publish: publish:
executor: besu_executor_med executor: besu_executor_med

@ -238,7 +238,7 @@ allprojects {
*/ */
test { test {
jvmArgs = [ jvmArgs = [
'-Xmx2g', '-Xmx4g',
'-XX:-UseGCOverheadLimit', '-XX:-UseGCOverheadLimit',
// Mockito and jackson-databind do some strange reflection during tests. // Mockito and jackson-databind do some strange reflection during tests.
// This suppresses an illegal access warning. // 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} ." 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) { task dockerUpload(type: Exec) {
dependsOn distDocker dependsOn distDocker
def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}"
def imageName = "hyperledger/besu" def imageName = "hyperledger/besu"
def image = project.hasProperty('release.releaseVersion') ? "${imageName}:" + project.property('release.releaseVersion') : "${imageName}:${project.version}" def image = project.hasProperty('release.releaseVersion') ? "${imageName}:" + project.property('release.releaseVersion') : "${imageName}:${project.version}"
def cmd = "docker push '${image}'" def cmd = "docker push '${image}'"

Loading…
Cancel
Save