From 4c70b769661751eb545e23b489f713ace2101d22 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Wed, 24 Jan 2018 18:17:22 -0300 Subject: [PATCH 1/9] Show message in the apk name --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1b46182..2f14a36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,9 @@ jobs: destination: apks/ - run: name: Upload to Slack - command: curl -F file=@app/build/outputs/apk/debug/app-debug.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${CIRCLE_SHA1}" https://slack.com/api/files.upload + command: | + export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') + curl -F file=@app/build/outputs/apk/debug/app-debug.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload workflows: From 2eae0d19d13fe0a85b40886a4c961b0583c618b1 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Sun, 15 Apr 2018 18:22:29 -0300 Subject: [PATCH 2/9] Improvement: Divided jobs for don't repeat code for release and debug builds --- .circleci/config.yml | 118 ++++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f14a36..4b54940 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,39 +1,97 @@ -version: 2 -jobs: - dev-build: +version: 2.0 + +references: + workspace: &workspace + ~/code + + config_android: &config_android + working_directory: *workspace docker: - - image: circleci/android:api-27-alpha #SDK version - working_directory: ~/code + - image: circleci/android:api-27-alpha + + cache_key: &cache_key + key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} + restore_cache: &restore_cache + restore_cache: + <<: *cache_key + save_cache: &save_cache + save_cache: + <<: *cache_key + paths: + - ~/.gradle + + store_artifacts: &store_artifacts + store_artifacts: + path: app/build/outputs/apk/ + destination: apks/ + + persist_to_workspace: &persist_to_workspace + persist_to_workspace: + root: . + paths: + - ./* + attach_workspace: &attach_workspace + attach_workspace: + at: *workspace + +jobs: + build: + <<: *config_android + steps: - - checkout - - run: echo "Starting..." - - restore_cache: - key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - - run: + - checkout + - run: echo "Starting..." + - *restore_cache + - run: name: Download Dependencies command: ./gradlew androidDependencies - - save_cache: - paths: - - ~/.gradle - key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} - - run: - name: Initial build - command: ./gradlew clean assembleDebug --no-daemon --stacktrace - - store_artifacts: - path: app/build/outputs/apk/ - destination: apks/ - - run: - name: Upload to Slack - command: | - export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') - curl -F file=@app/build/outputs/apk/debug/app-debug.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload - - + - *save_cache + - *persist_to_workspace + + debug-build: + <<: *config_android + + steps: + - *attach_workspace + - run: + name: Initial debug build + command: ./gradlew clean assembleDebug --no-daemon --stacktrace + - *store_artifacts + - run: + name: Uploading debug build to Slack + command: | + export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') + curl -F file=@app/build/outputs/apk/debug/app-debug.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload + + release-build: + <<: *config_android + + steps: + - *attach_workspace + - run: + name: Initial debug build + command: ./gradlew clean assembleRelease --no-daemon --stacktrace + - *store_artifacts + - run: + name: Upload release build to Slack + command: | + export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') + curl -F file=@app/build/outputs/apk/release/app-release.apk -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload + workflows: version: 2 - deploy: + build_workflow: jobs: - - dev-build: + - build + - debug-build: + requires: + - build + filters: + branches: + only: circleImprovements + - release-build: + requires: + - build filters: branches: - only: develop+MVP+RX \ No newline at end of file + only: master \ No newline at end of file From 27084142c2644bba0c800b590e477192a53ce71c Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 16:54:02 -0300 Subject: [PATCH 3/9] Finish CircleCI improvement --- .circleci/config.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4b54940..f1daebe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,7 +69,7 @@ jobs: steps: - *attach_workspace - run: - name: Initial debug build + name: Initial release build command: ./gradlew clean assembleRelease --no-daemon --stacktrace - *store_artifacts - run: @@ -88,10 +88,4 @@ workflows: - build filters: branches: - only: circleImprovements - - release-build: - requires: - - build - filters: - branches: - only: master \ No newline at end of file + only: develop+MVP+RX \ No newline at end of file From 69571c9d387a9a1c776d9039a337cc858e3e6550 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 17:22:48 -0300 Subject: [PATCH 4/9] Generate Test reports on CircleCI --- .circleci/config.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1daebe..65f1b03 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,9 +48,24 @@ jobs: - *save_cache - *persist_to_workspace - debug-build: + tests: <<: *config_android + steps: + - *attach_workspace + - run: + name: Run Tests + command: ./gradlew lint test + - store_artifacts: + path: app/build/reports + destination: reports + - store_test_results: + path: app/build/test-results + - *persist_to_workspace + + debug-build: + <<: *config_android + steps: - *attach_workspace - run: @@ -86,6 +101,7 @@ workflows: - debug-build: requires: - build + - test filters: branches: - only: develop+MVP+RX \ No newline at end of file + only: circleImprovements \ No newline at end of file From 00f2b3915e9948effb61e1368393649803927b3c Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 17:46:06 -0300 Subject: [PATCH 5/9] Fix test CircleCI --- .circleci/config.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 65f1b03..78ccc6c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,23 +48,8 @@ jobs: - *save_cache - *persist_to_workspace - tests: - <<: *config_android - - steps: - - *attach_workspace - - run: - name: Run Tests - command: ./gradlew lint test - - store_artifacts: - path: app/build/reports - destination: reports - - store_test_results: - path: app/build/test-results - - *persist_to_workspace - debug-build: - <<: *config_android + <<: *config_android steps: - *attach_workspace From 73921ee04e4d96a8acd7c6d4916ade09abfaeca2 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 17:55:02 -0300 Subject: [PATCH 6/9] CircleCI test reports added --- .circleci/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78ccc6c..501786a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,21 @@ jobs: - *save_cache - *persist_to_workspace + tests: + <<: *config_android + + steps: + - *attach_workspace + - run: + name: Run Tests + command: ./gradlew lint test + - store_artifacts: + path: app/build/reports + destination: reports + - store_test_results: + path: app/build/test-results + - *persist_to_workspace + debug-build: <<: *config_android From 4f2ce4e1f2891746c235314814d8eff2f7c31c63 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 17:58:27 -0300 Subject: [PATCH 7/9] Job test CircleCI --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 501786a..ec78e9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,6 +98,7 @@ workflows: build_workflow: jobs: - build + - tests - debug-build: requires: - build From d9fbbbd6f710941128b1d863cfd9717216f5f025 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Mon, 21 May 2018 18:03:08 -0300 Subject: [PATCH 8/9] CircleCI fix --- .circleci/config.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec78e9a..b575624 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: - *save_cache - *persist_to_workspace - tests: + test: <<: *config_android steps: @@ -98,10 +98,11 @@ workflows: build_workflow: jobs: - build - - tests - - debug-build: + - test: requires: - build + - debug-build: + requires: - test filters: branches: From a468e953ffdda822b058e568723df2e7cd9ea1a7 Mon Sep 17 00:00:00 2001 From: Ezequiel Fernandez Excoffon Date: Wed, 6 Jun 2018 18:08:45 -0300 Subject: [PATCH 9/9] Check build and debug build added --- .circleci/config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c7af2b..ac16175 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,9 +101,16 @@ workflows: - test: requires: - build + filters: + branches: + ignore: + - develop+MVP+RX + - /^dev-build-.*/ - debug-build: requires: - test filters: branches: - only: develop+MVP+RX + only: + - develop+MVP+RX + - /^dev-build-.*/