Skip to content

Instantly share code, notes, and snippets.

@JacquesSmuts
Last active December 26, 2018 08:31
Show Gist options
  • Save JacquesSmuts/40994bd8d0fb675085ddaff743571aa7 to your computer and use it in GitHub Desktop.
Save JacquesSmuts/40994bd8d0fb675085ddaff743571aa7 to your computer and use it in GitHub Desktop.
snippet of jobs with deploy_stage and deploy_live running based on branch
version: 2
jobs:
deploy_staging:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Decode and store Keystore
command: |
echo $ENCODED_KEYSTORE | base64 --decode >> ${HOME}/keystore
echo 'export KEYSTORE=${HOME}/keystore' >> $BASH_ENV
- run:
name: Decode and store Keystore
command: |
echo $DEPLOYMENT_PRIVATE_KEY | base64 --decode >> ${HOME}/rxstarter_pk.json
echo 'export PRIVATE_KEY=${HOME}/rxstarter_pk.json' >> $BASH_ENV
- run:
name: Upload to Google Play
command: ./gradlew publishStagingRelease
workflows:
version: 2
build-and-deploy:
jobs:
- build
- tests:
requires:
- build
- deploy_live:
requires:
- build
- tests
filters:
branches:
only:
- master
- deploy_staging:
requires:
- build
- tests
filters:
branches:
only:
- develop
- release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment