Skip to content

Instantly share code, notes, and snippets.

@patw0929
Last active January 29, 2020 00:13
Show Gist options
  • Save patw0929/ae507a47bfac700847b134a663fe9ff9 to your computer and use it in GitHub Desktop.
Save patw0929/ae507a47bfac700847b134a663fe9ff9 to your computer and use it in GitHub Desktop.
Bitrise Setting Example
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
workflows:
production:
after_run:
- _base
- _test_node
- _build
- _deploy_to_store
- _send_to_slack_for_store
meta:
bitrise.io:
stack: osx-vs4mac-previous-stable
staging:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
#!/bin/bash
envman add --key ENVIRONMENT --value "Production"
envman add --key BITRISE_SCHEME --value "f2eFindJobs"
after_run:
- _base
- _test_node
- _build
- _deploy_to_bitrise
- _send_to_slack
meta:
bitrise.io:
stack: osx-vs4mac-previous-stable
_base:
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]:
inputs:
- args: "--frozen-lockfile"
- command: install
title: yarn install
_test_node:
steps:
- [email protected]:
inputs:
- command: test
title: yarn test
_send_to_slack:
steps:
- [email protected]:
inputs:
- webhook_url: https://hooks.slack.com/services/xxxx/xxxx/xxxxxx
- channel: "#app"
- message_on_error: |
Ah! Something went wrong
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|Android
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- from_username: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- OK
- from_username_on_error: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- ERROR
- emoji: ":green_apple:"
- emoji_on_error: ":apple:"
- image_url: "$ANDROID_INSTALL_PAGE_QRCODE"
- icon_url: "$ANDROID_INSTALL_PAGE_QRCODE"
- fields: |-
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|Android
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
Install Android|${ANDROID_INSTALL_PAGE}
- pretext: "*Android App Upload Succeeded!*"
- buttons: |-
View App|${BITRISE_APP_URL}
View Build|${BITRISE_BUILD_URL}
Install Android|${ANDROID_INSTALL_PAGE}
_send_to_slack_for_store:
steps:
- [email protected]:
inputs:
- webhook_url: https://hooks.slack.com/services/xxxx/xxxx/xxxxxx
- channel: "#app"
- message_on_error: |
Ah! Something went wrong
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|Android
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- from_username: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- OK
- from_username_on_error: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- ERROR
- emoji: ":green_apple:"
- emoji_on_error: ":apple:"
- fields: |-
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|Android
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- pretext: "*Android App Upload Succeeded!*"
- buttons: |-
View App|${BITRISE_APP_URL}
View Build|${BITRISE_BUILD_URL}
_build:
steps:
- [email protected]: {}
- [email protected]:
inputs:
- build_gradle_path: "$BITRISE_SOURCE_DIR/android/app/build.gradle"
- [email protected]:
inputs:
- package_identifier: com.xxx.xxxxx
- version_code: "$BITRISE_BUILD_NUMBER"
- android_manifest_path: "$BITRISE_SOURCE_DIR/android/app/src/main/AndroidManifest.xml"
- [email protected]:
inputs:
- project_location: "$PROJECT_LOCATION"
- variant: Release
- module: "$MODULE"
- [email protected]: {}
_deploy_to_bitrise:
steps:
- deploy-to-bitrise-io:
inputs:
- deploy_path: "$BITRISE_SIGNED_APK_PATH"
outputs:
- BITRISE_PUBLIC_INSTALL_PAGE_URL: ANDROID_INSTALL_PAGE
- [email protected]:
inputs:
- public_install_page_url: "$ANDROID_INSTALL_PAGE"
outputs:
- BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL: ANDROID_INSTALL_PAGE_QRCODE
_deploy_to_store:
steps:
- [email protected]:
inputs:
- json_key_path: "$"
- package_name: com.xxx.xxxxx
- track: beta
- service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL"
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: android
- GRADLEW_PATH: android/gradlew
- MODULE: app
opts:
is_expand: false
- opts:
is_expand: false
GRADLE_BUILD_FILE_PATH: android/
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: development
trigger_map:
- push_branch: master
workflow: production
- pull_request_source_branch: "*"
workflow: staging
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
workflows:
_base:
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]:
inputs:
- args: "--frozen-lockfile"
- command: install
title: yarn install
_test_node:
steps:
- [email protected]:
inputs:
- command: test
title: yarn test
_send_to_slack:
steps:
- [email protected]:
inputs:
- webhook_url: https://hooks.slack.com/services/xxx/xxx/xxxxx
- channel: "#app"
- message_on_error: |
Ah! Something went wrong
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|iOS
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- from_username: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- OK
- from_username_on_error: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- ERROR
- emoji: ":green_apple:"
- emoji_on_error: ":apple:"
- image_url: "$IOS_INSTALL_PAGE_QRCODE"
- icon_url: "$IOS_INSTALL_PAGE_QRCODE"
- fields: |-
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|iOS
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
Install iOS|${IOS_INSTALL_PAGE}
- pretext: "*iOS App Upload Succeeded!*"
- buttons: |-
View App|${BITRISE_APP_URL}
View Build|${BITRISE_BUILD_URL}
Install iOS|${IOS_INSTALL_PAGE}
_send_to_slack_for_store:
steps:
- [email protected]:
inputs:
- webhook_url: https://hooks.slack.com/services/xxx/xxx/xxxxx
- channel: "#app"
- message_on_error: |
Ah! Something went wrong
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|iOS
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- from_username: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- OK
- from_username_on_error: Bitrise CI - $BITRISE_APP_TITLE $BITRISE_TRIGGERED_WORKFLOW_TITLE
- ERROR
- emoji: ":green_apple:"
- emoji_on_error: ":apple:"
- fields: |-
App|${BITRISE_APP_TITLE}
Build number|${BITRISE_BUILD_NUMBER}
PR ID|${BITRISE_PULL_REQUEST}
Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
Environment|${ENVIRONMENT}
Branch|${BITRISE_GIT_BRANCH}
Platform|iOS
CommitID|${BITRISE_GIT_COMMIT}
Git message|${BITRISE_GIT_MESSAGE}
- pretext: "*iOS App Upload Succeeded!*"
- buttons: |-
View App|${BITRISE_APP_URL}
View Build|${BITRISE_BUILD_URL}
_build_ios_release_without_pod_install:
steps:
- [email protected]: {}
- [email protected]:
inputs:
- plist_path: "$BITRISE_SOURCE_DIR/ios/demoApp/Info.plist"
- [email protected]:
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
- export_method: "$BITRISE_EXPORT_METHOD"
- configuration: "$BITRISE_ARCHIVE_CONFIG"
_deploy_to_store:
steps:
- [email protected]:
inputs:
- password: "$ITUNES_CONNECT_PASSWORD"
- app_password: "$ITUNES_APP_PASSWORD"
- itunescon_user: "$ITUNES_CONNECT_EMAIL"
_deploy_to_bitrise:
steps:
- [email protected]:
inputs:
- deploy_path: "$BITRISE_IPA_PATH"
outputs:
- BITRISE_PUBLIC_INSTALL_PAGE_URL: IOS_INSTALL_PAGE
- [email protected]:
inputs:
- public_install_page_url: "$IOS_INSTALL_PAGE"
outputs:
- BITRISE_PUBLIC_INSTALL_PAGE_QR_CODE_IMAGE_URL: IOS_INSTALL_PAGE_QRCODE
production:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
#!/bin/bash
envman add --key ENVIRONMENT --value "Production"
envman add --key BITRISE_SCHEME --value "demoApp"
envman add --key BITRISE_ARCHIVE_CONFIG --value "Release"
envman add --key BITRISE_EXPORT_METHOD --value "app-store"
after_run:
- _base
- _build_ios_release_without_pod_install
- _deploy_to_store
- _send_to_slack_for_store
meta:
bitrise.io:
stack: osx-vs4mac-previous-stable
staging:
steps:
- [email protected]:
title: Set Environment
inputs:
- content: |-
#!/bin/bash
envman add --key ENVIRONMENT --value "Development"
envman add --key BITRISE_SCHEME --value "demoApp"
envman add --key BITRISE_ARCHIVE_CONFIG --value "Release"
envman add --key BITRISE_EXPORT_METHOD --value "development"
after_run:
- _base
- _build_ios_release_without_pod_install
- _deploy_to_bitrise
- _send_to_slack
meta:
bitrise.io:
stack: osx-vs4mac-previous-stable
app:
envs:
- opts:
is_expand: false
BITRISE_PROJECT_PATH: ios/demoApp.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: demoApp
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: app-store
- opts:
is_expand: false
APP_ID: xx.xxx.demoApp
trigger_map:
- push_branch: master
workflow: production
- pull_request_source_branch: "*"
workflow: staging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment