Skip to content

Instantly share code, notes, and snippets.

@PillowUnicorn
Created April 28, 2017 22:21
Show Gist options
  • Save PillowUnicorn/1dcb98e4e43a4cbd2afd086aae689d73 to your computer and use it in GitHub Desktop.
Save PillowUnicorn/1dcb98e4e43a4cbd2afd086aae689d73 to your computer and use it in GitHub Desktop.
Pillow's Android bitrise.yml
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: qa
workflow: qa
workflows:
_init_install:
steps:
- activate-ssh-key:
title: Activate App SSH key
inputs:
- ssh_key_save_path: "$HOME/.ssh/steplib_ssh_step_id_rsa"
- git-clone: {}
- [email protected]:
title: Set Full Build
inputs:
- content: |-
#!/bin/bash
if [[ "$GIT_CLONE_COMMIT_MESSAGE_SUBJECT" == *"[FULL BUILD]"* ]]
then
envman add --key RUN_GRADLEW --value 1
else
envman add --key RUN_GRADLEW --value 0
fi
- [email protected]:
title: Install npm-cache
inputs:
- content: |-
#!/bin/bash
npm install -g npm-cache
- [email protected]: {}
- [email protected]:
title: npm-cache install
inputs:
- content: |-
npm-cache install --cacheDirectory .
- [email protected]:
inputs:
- cache_paths: "./npm"
before_run:
after_run:
_code_push:
steps:
- [email protected]:
title: Install CodePush CLI
inputs:
- content: |-
#!/bin/bash
npm install -g code-push-cli
- [email protected]:
title: CodePush auth
inputs:
- content: |-
#!/bin/bash
code-push login --accessKey #YOUR_CODEPUSH_KEY
- [email protected]:
title: CodePush deploy
inputs:
- content: |-
#!/bin/bash
code-push release-react $YOUR_CODEPUSH_PROJECT android -d $ENVIRONMENT --description "$ENVIRONMENT $GIT_CLONE_COMMIT_MESSAGE_SUBJECT" -m
before_run:
after_run:
_make_apk:
steps:
- [email protected]:
title: gradlew
run_if: '{{enveq "RUN_GRADLEW" "1"}}'
inputs:
- content: |-
#!/bin/bash
export ENVFILE=$ENVFILE && cd android && ./gradlew assembleRelease
- [email protected]:
run_if: '{{enveq "RUN_GRADLEW" "1"}}'
inputs:
- apk_path: "/bitrise/src/android/app/build/outputs/apk/app-release-unsigned.apk"
- [email protected]:
title: cp apk
run_if: '{{enveq "RUN_GRADLEW" "1"}}'
inputs:
- content: |-
#!/bin/bash
cp $BITRISE_SIGNED_APK_PATH $BITRISE_DEPLOY_DIR/signed-app-release.apk
- [email protected]:
is_always_run: false
run_if: '{{enveq "RUN_GRADLEW" "1"}}'
inputs:
- notify_email_list: ''
before_run:
after_run:
production:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
#!/bin/bash
envman add --key ENVIRONMENT --value "Production"
- [email protected]:
inputs:
- source: "$BITRISEIO_production_env_URL"
- destination: "$BITRISE_SOURCE_DIR/environment"
- [email protected]:
title: set ENVFILE
inputs:
- content: |-
envman add --key ENVFILE --value environment
before_run:
- _init_install
after_run:
- _make_apk
- _code_push
- _slack_message
_slack_message:
steps:
- [email protected]:
inputs:
- webhook_url: #YOUR_SLACK_WEBHOOK
- channel: "#engineering-alerts"
- from_username: Bitrise CI - iOS $ENVIRONMENT CodePush Deploy Succeeded
- from_username_on_error: Bitrise CI - iOS $ENVIRONMENT CodePush Deploy Failed
- message: 'Test the changes on the latest $ENVIRONMENT build. Click here
to download the build: https://www.pillowhomes.com/apps'
- message_on_error: 'Click here to find out why the build failed: $BITRISE_BUILD_URL'
- emoji: ":confetti_ball:"
- emoji_on_error: ":shrug:"
before_run:
after_run:
staging:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
envman add --key ENVIRONMENT --value "Staging"
envman add --key ENVFILE --value .env.staging
before_run:
- _init_install
after_run:
- _make_apk
- _code_push
- _slack_message
qa:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
envman add --key ENVIRONMENT --value "QA"
envman add --key ENVFILE --value .env.qa
before_run:
- _init_install
after_run:
- _make_apk
- _code_push
- _slack_message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment