Create a gist now

Instantly share code, notes, and snippets.

@sjlu /README.md
Last active Nov 10, 2017

What would you like to do?
Automating builds with CircleCI and HockeyApp
#!/bin/sh
KEYCHAIN_PASSWORD=circleci
security create-keychain -p $KEYCHAIN_PASSWORD ios-build.keychain
security import ./scripts/apple.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign
security import ./scripts/dev.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign
security import ./scripts/dist.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign
security import ./scripts/dev.p12 -k ~/Library/Keychains/ios-build.keychain -P $KEY_PASSWORD -T /usr/bin/codesign
security import ./scripts/dist.p12 -k ~/Library/Keychains/ios-build.keychain -P $KEY_PASSWORD -T /usr/bin/codesign
security list-keychain -s ~/Library/Keychains/ios-build.keychain
security unlock-keychain -p $KEYCHAIN_PASSWORD ~/Library/Keychains/ios-build.keychain
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp ./scripts/profile/* ~/Library/MobileDevice/Provisioning\ Profiles/
#!/bin/sh
#/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CIRCLE_BUILD_NUM" "yourappname/Info.plist"
ipa build --verbose -c Release
machine:
xcode:
version: "6.3.1"
dependencies:
pre:
- sudo gem install cocoapods
test:
override:
- ./scripts/add-key.sh
- ./scripts/build.sh
- ./scripts/remove-key.sh
deployment:
hockey:
branch: master
commands:
- ./scripts/deploy.sh
#!/bin/sh
ipa distribute:hockeyapp -m "$CIRCLE_SHA1" --token $HOCKEYAPP_TOKEN
#!/bin/sh
security delete-keychain ios-build.keychain
rm -f ~/Library/MobileDevice/Provisioning\ Profiles/*
@marcomorain

This comment has been minimized.

Show comment Hide comment
@marcomorain

marcomorain Aug 18, 2015

Hi @sjlu - you can remove the remove-key.sh script here - all builds run a fresh container so there no need to clean up after yourself.

You can also remove the call to install cocoapods – it's installed by default on our containers.

Hi @sjlu - you can remove the remove-key.sh script here - all builds run a fresh container so there no need to clean up after yourself.

You can also remove the call to install cocoapods – it's installed by default on our containers.

@marcomorain

This comment has been minimized.

Show comment Hide comment
@marcomorain

marcomorain Aug 18, 2015

also, nice work 🤘

also, nice work 🤘

@sjlu

This comment has been minimized.

Show comment Hide comment
@sjlu

sjlu Aug 18, 2015

@marcomorain I found that cocoapods needs to be updated in order for certain things to build correctly. The current version on CircleCI seems to have a related bug to code signing.

Owner

sjlu commented Aug 18, 2015

@marcomorain I found that cocoapods needs to be updated in order for certain things to build correctly. The current version on CircleCI seems to have a related bug to code signing.

@adcooley

This comment has been minimized.

Show comment Hide comment
@adcooley

adcooley Sep 14, 2015

how is the ipa command available? I'm only finding that here… (https://github.com/nomad/shenzhen) but doesn't appear it would be installed automatically on circle.

how is the ipa command available? I'm only finding that here… (https://github.com/nomad/shenzhen) but doesn't appear it would be installed automatically on circle.

@sjlu

This comment has been minimized.

Show comment Hide comment
@sjlu

sjlu Oct 16, 2015

They may have updated it in their recent Xcode build? I'm not really sure.

Owner

sjlu commented Oct 16, 2015

They may have updated it in their recent Xcode build? I'm not really sure.

@dmackerman

This comment has been minimized.

Show comment Hide comment
@dmackerman

dmackerman Jan 5, 2016

FWIW, The link in the README actually goes to http://localhost:4000/posts/2015/08/18/circleci-ios-builds-to-hockeyapp/. 😄

FWIW, The link in the README actually goes to http://localhost:4000/posts/2015/08/18/circleci-ios-builds-to-hockeyapp/. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment