Last active
January 30, 2017 22:38
-
-
Save mxaly/177d5ad0d855c5287f1e2079dae5ad7e to your computer and use it in GitHub Desktop.
example bitrise andorid configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# bitrise.yml | |
# | |
# Copyright (c) 2017 Netguru Sp. z o.o. All rights reserved. | |
# | |
# CLI metadata | |
format_version: 1.1.0 | |
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git | |
# Environment configuration | |
app: | |
envs: | |
- GRADLE_BUILD_FILE_PATH: android/build.gradle | |
- GRADLE_TASK: assembleRelease | |
- GRADLEW_PATH: android/gradlew | |
# Workflow trigger map | |
trigger_map: | |
- pattern: master | |
is_pull_request_allowed: false | |
workflow: staging | |
- pattern: '*' | |
is_pull_request_allowed: false | |
workflow: build | |
# Workflow declarations | |
workflows: | |
build: | |
before_run: | |
- build-native | |
- test | |
- run-gradle | |
steps: | |
- deploy-to-bitrise-io: | |
inputs: | |
- notify_user_groups: none | |
# - sign-apk: {} | |
staging: | |
envs: | |
- HOCKEYAPP_API_TOKEN: $HOCKEYAPP_API_TOKEN_STAGING | |
- HOCKEYAPP_APP_ID: $HOCKEYAPP_APP_ID_STAGING | |
before_run: | |
- build-native | |
- test | |
- run-gradle | |
steps: | |
# - sign-apk: {} | |
- deploy-to-bitrise-io: | |
inputs: | |
- notify_user_groups: none | |
# after_run: | |
# - deploy-hockeyapp | |
# build | |
build-native: | |
# before_run: | |
# - create-env-file | |
steps: | |
- nvm: {} | |
- script@1.1.3: | |
title: yarn install | |
inputs: | |
- content: "#!/bin/bash\n# fail if any commands fails\nset -e\n# debug log\nset | |
-x\n\nif [ -f /etc/lsb-release ]; then\n if which yarn >/dev/null; then\n | |
\ echo \"Yarn already installed.\"\n else\n echo \"Yarn not installed. | |
Installing...\"\n sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3\n | |
\ echo \"deb http://dl.yarnpkg.com/debian/ stable main\" | sudo tee | |
/etc/apt/sources.list.d/yarn.list\n sudo apt-get update && sudo apt-get | |
install yarn\n fi\nelse\n echo \"doing nothing with yarn here\" \nfi\n\nyarn | |
install" | |
- install-react-native@0.9.1: {} | |
- react-native-bundle@1.0.2: {} | |
test: | |
steps: | |
- script@1.1.3: | |
title: npm test | |
inputs: | |
- content: |- | |
#!/bin/bash | |
set -e | |
set -x | |
npm test | |
run-gradle: | |
steps: | |
- script@1.1.3: | |
title: Update Android Extra packages | |
inputs: | |
- content: | | |
#!/bin/bash | |
set -ex | |
echo y | android update sdk --no-ui --all --filter build-tools-23.0.1 | grep 'package installed' | |
echo y | android update sdk --no-ui --all --filter platform-tools | grep 'package installed' | |
echo y | android update sdk --no-ui --all --filter extra-android-m2repository | grep 'package installed' | |
echo y | android update sdk --no-ui --all --filter extra-google-m2repository | grep 'package installed' | |
echo y | android update sdk --no-ui --all --filter extra-google-google_play_services | grep 'package installed' | |
- gradle-runner@1.5.2: | |
inputs: | |
- gradle_task: "$GRADLE_TASK" | |
# Deploy | |
deploy-hockeyapp: | |
steps: | |
- hockeyapp-deploy-android: | |
inputs: | |
- api_token: $HOCKEYAPP_API_TOKEN | |
- app_id: $HOCKEYAPP_APP_ID | |
- apk_path: $BITRISE_SIGNED_APK_PATH | |
create-env-file: | |
steps: | |
- ruby-script@2.1.0: | |
inputs: | |
- ruby_content: |- | |
template = ENV['DOTENV_TEMPLATE_FILE'] || '.env.bitrise' | |
output_file = ENV['DOTENV_OUTPUT_FILE'] || '.env' | |
File.open(output_file, 'w') do |output| | |
File.open(template).each do |line| | |
output.write(line.sub(/\$[A-Z0-9_]+/) { |match| ENV[match.sub('$', '')] }) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment