Skip to content

Instantly share code, notes, and snippets.

@emalherbi-zz
Forked from jrschumacher/build-and-deploy.sh
Created June 28, 2017 14:12
Show Gist options
  • Save emalherbi-zz/41e487f277dd2d5a55cda68e09613238 to your computer and use it in GitHub Desktop.
Save emalherbi-zz/41e487f277dd2d5a55cda68e09613238 to your computer and use it in GitHub Desktop.
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/local/bin/npm install
/usr/local/bin/bower install
### Restore ionic platforms
echo "--- Restore ionic platforms [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/local/bin/ionic state restore
### Build
echo "--- Build [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/local/bin/gulp sass
/usr/local/bin/gulp build
### Moving to ios build directory
echo "--- Moving to ios build directory [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
cd platforms/ios
### Cleaning Xcode
echo "--- Cleaning Xcode [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/bin/xcodebuild clean \
-project $PROJECT_NAME.xcodeproj \
-configuration Release \
-alltargets
### Archiving
echo "--- Archiving [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/bin/xcodebuild archive \
-project $PROJECT_NAME.xcodeproj \
-scheme $SCHEME_NAME \
-archivePath $PROJECT_NAME
### Uploading to Hockeyapp
echo "--- Uploading to Hockeyapp [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
/usr/local/bin/puck \
-notes_path=../../RELEASE_NOTES.md \
-notes_type=markdown \
-submit=auto \
-download=true \
-mandatory=true \
-notify=true \
-force=true \
$PROJECT_NAME.xcarchive
### Summary
echo "-- Total time $(($(date +%s) - $STARTTIME))s"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment