Skip to content

Instantly share code, notes, and snippets.

@jlcarvalho
Last active January 10, 2017 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlcarvalho/ff0fb3f92d89eb4e9d6b8c1f1c387502 to your computer and use it in GitHub Desktop.
Save jlcarvalho/ff0fb3f92d89eb4e9d6b8c1f1c387502 to your computer and use it in GitHub Desktop.
---
format_version: 1.3.1
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- IONIC_PROJ_DIR_PATH: "./handup"
- BITRISE_PROJECT_PATH: "./platforms/ios/handup.xcodeproj"
- BITRISE_SCHEME: handup
- FORCE_TEAM_ID: 6DLEBYX6Q8
trigger_map:
- push_branch: master
workflow: ci-ios
- pull_request_source_branch: "*"
workflow: ci-ios
workflows:
_ci_finish:
steps:
- deploy-to-bitrise-io@1.2.6:
run_if: '{{getenv "BITRISE_BUILD_URL" | ne ""}}'
_ci_setup:
steps:
- activate-ssh-key@3.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@3.4.1: {}
_ci_setup_android_tests:
steps:
- script@1.1.3:
title: Setup test env
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -e
apt-get update && apt-get install -y apt-transport-https unzip
curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
apt-get update && apt-get install -y dbus-x11 xvfb google-chrome-stable --no-install-recommends
apt-get purge --auto-remove -y apt-transport-https
rm -rf /var/lib/apt/lists/*
cp xvfb-chromium /usr/bin/xvfb-chromium
chmod a+x /usr/bin/xvfb-chromium
envman add --key CHROME_BIN --value "/usr/bin/xvfb-chromium"
opts: {}
_ci_setup_ios_tests:
steps:
- script@1.1.3:
title: Setup test env
inputs:
- content: |-
#!/bin/bash
# fail if any commands fails
set -e
brew tap caskroom/cask
brew cask install google-chrome
opts: {}
test:
steps:
- change-workdir@1.0.1:
title: Change workdir to ionic project dir
inputs:
- path: "$IONIC_PROJ_DIR_PATH"
- is_create_path: 'false'
- script@1.1.3:
title: Test the app
inputs:
- content: |-
#!/bin/bash
set -ex
#
npm install
node ./node_modules/protractor/bin/webdriver-manager update
mkdir -p www
npm run test:all
opts: {}
build-android:
steps:
- script@1.1.3:
title: Build the app for distribution
inputs:
- content: |-
#!/bin/bash
set -ex
#
ionic platform add android
ionic build android --prod
mv ./platforms/android/build/outputs/apk/android-debug.apk "${BITRISE_DEPLOY_DIR}"
opts: {}
build-ios:
steps:
- script@1.1.3:
title: Build the app for distribution
inputs:
- content: |-
#!/bin/bash
set -ex
#
ionic platform add ios
ionic build ios --prod
- recreate-user-schemes:
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- certificate-and-profile-installer@1.8.2: {}
- xcode-archive@2.0.4:
inputs:
- force_team_id: "$FORCE_TEAM_ID"
- force_code_sign_identity: iPhone Developer
ci-android:
before_run:
- _ci_setup
- _ci_setup_android_tests
after_run:
- test
- build-android
- _ci_finish
ci-ios:
before_run:
- _ci_setup
- _ci_setup_ios_tests
after_run:
- test
- build-ios
- _ci_finish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment