From 367363b5a55bb434cbcacfbd3354722ac6964492 Mon Sep 17 00:00:00 2001 From: WasiqB Date: Sun, 16 Sep 2018 17:13:21 +0530 Subject: [PATCH 1/2] Updated CircleCI config to configure new workflow pipeline. Tests are currently skipped. --- .circleci/config.yml | 121 +++++++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1591277..e1d3835 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,50 +1,95 @@ -# Java Maven CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-java/ for more details -# +default: &default + working_directory: ~/repo + docker: + - image: circleci/openjdk:8-jdk version: 2 jobs: - build: - machine: true - working_directory: ~/code + code_checkout: + <<: *default steps: - - run: - name: Install Docker Compose - command: | - curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > ~/docker-compose - chmod +x ~/docker-compose - sudo mv ~/docker-compose /usr/local/bin/docker-compose - - setup_remote_docker - - run: - name: Start container and verify it's working - command: | - set -x - docker-compose up -d - docker run --network container:contacts \ - appropriate/curl --retry 10 --retry-delay 1 --retry-connrefused http://localhost:8080/contacts/test - - run: - name: Launch emulator - command: export LD_LIBRARY_PATH=${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib && emulator64-arm -avd test -noaudio -no-boot-anim -no-window -accel on - background: true - checkout + - save_cache: + key: repo-{{ .Branch }}-{{ .Revision }} + paths: + - ~/repo + resolve_dependencies: + <<: *default + steps: - restore_cache: keys: - - v1-dependencies-{{ checksum "pom.xml" }} - - v1-dependencies- + - repo-{{ .Branch }}-{{ .Revision }} - run: - name: Resolve dependencies - command: mvn dependency:go-offline + name: Resolve Dependencies + command: mvn dependency:resolve - save_cache: paths: - ~/.m2 - key: v1-dependencies-{{ checksum "pom.xml" }} + key: repo-dependency-{{ .Branch }}-{{ .Revision }} + build: + <<: *default + steps: + - restore_cache: + keys: + - repo-{{ .Branch }}-{{ .Revision }} + - repo-dependency-{{ .Branch }}-{{ .Revision }} - run: - name: Wait for emulator - command: | - chmod +x ~/code/script/android-wait-for-boot.sh; - ~/code/script/android-wait-for-boot.sh; - environment: - TERM: dumb + name: Build project + command: mvn clean install -DskipTests=true + - save_cache: + key: repo-target-{{ .Branch }}-{{ .Revision }} + paths: + - target/ + test: + <<: *default + steps: + - restore_cache: + keys: + - repo-{{ .Branch }}-{{ .Revision }} + - repo-dependencies-{{ .Branch }}-{{ .Revision }} + - repo-target-{{ .Branch }}-{{ .Revision }} + - run: + name: Run Tests with Sonar Coverage + command: mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test + - save_cache: + key: repo-reports-{{ .Branch }}-{{ .Revision }} + paths: + - reports/ + code_analysis: + <<: *default + steps: + - restore_cache: + keys: + - repo-{{ .Branch }}-{{ .Revision }} + - repo-dependencies-{{ .Branch }}-{{ .Revision }} + - repo-target-{{ .Branch }}-{{ .Revision }} + - repo-reports-{{ .Branch }}-{{ .Revision }} - run: - name: Run UI Tests - command: mvn integration-test \ No newline at end of file + name: Update Sonar Analysis + command: mvn package sonar:sonar -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_KEY + +filters: &all_branches + branches: + only: + - develop + - master + - release + - /issue-.*/ + +workflows: + version: 2 + normal_flow: + jobs: + - code_checkout: + filters: *all_branches + - resolve_dependencies: + filters: *all_branches + requires: + - code_checkout + - build: + filters: *all_branches + requires: + - resolve_dependencies + - code_analysis: + requires: + - build + filters: *all_branches From 742cb12c669c01a43b53366504dc17cf3425506e Mon Sep 17 00:00:00 2001 From: WasiqB Date: Sun, 16 Sep 2018 17:19:51 +0530 Subject: [PATCH 2/2] Removed code analysis pipeline. Will be added later. --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1d3835..cba99a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,8 +88,4 @@ workflows: - build: filters: *all_branches requires: - - resolve_dependencies - - code_analysis: - requires: - - build - filters: *all_branches + - resolve_dependencies \ No newline at end of file