Skip to content

Commit

Permalink
function removed
Browse files Browse the repository at this point in the history
  • Loading branch information
jacano committed Oct 26, 2017
1 parent d5bcb64 commit d9090f9
Showing 1 changed file with 22 additions and 26 deletions.
48 changes: 22 additions & 26 deletions build_ios.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
ZipAndUploadToDropbox () {

REMOTE_FOLDER=$1
ARTIFACT_NAME=$2
BUILD_DIR=$3

if [ -z "$DROPBOX_KEY" ]
then
DROPBOX_KEY=$(<secrets/dropboxkey.txt)
fi

DROPBOX_ARGS="Dropbox-API-Arg: {\"path\":\"$REMOTE_FOLDER/$ARTIFACT_NAME\", \"mode\":\"overwrite\"}"
DROPBOX_URL="https://content.dropboxapi.com/2/files/upload"
AUTHORIZATION_TOKEN="Authorization: Bearer $DROPBOX_KEY"
CONTENT_TYPE="Content-Type: application/octet-stream"

pushd $BUILD_DIR

zip -r $ARTIFACT_NAME .

curl -f -X POST --header "$AUTHORIZATION_TOKEN" --header "$CONTENT_TYPE" --header "$DROPBOX_ARGS" --data-binary @"$ARTIFACT_NAME" "$DROPBOX_URL"

popd
}

pushd src/crunch.iOS

xcodebuild -configuration Release -sdk iphonesimulator clean build
Expand All @@ -38,4 +13,25 @@ popd

popd

ZipAndUploadToDropbox "crunch" "ios.zip" "src/crunch.ios/build"

REMOTE_FOLDER="crunch"
ARTIFACT_NAME="ios.zip"
BUILD_DIR="src/crunch.ios/build"

if [ -z "$DROPBOX_KEY" ]
then
DROPBOX_KEY=$(<secrets/dropboxkey.txt)
fi

DROPBOX_ARGS="Dropbox-API-Arg: {\"path\":\"$REMOTE_FOLDER/$ARTIFACT_NAME\", \"mode\":\"overwrite\"}"
DROPBOX_URL="https://content.dropboxapi.com/2/files/upload"
AUTHORIZATION_TOKEN="Authorization: Bearer $DROPBOX_KEY"
CONTENT_TYPE="Content-Type: application/octet-stream"

pushd $BUILD_DIR

zip -r $ARTIFACT_NAME .

curl -f -X POST --header "$AUTHORIZATION_TOKEN" --header "$CONTENT_TYPE" --header "$DROPBOX_ARGS" --data-binary @"$ARTIFACT_NAME" "$DROPBOX_URL"

popd

0 comments on commit d9090f9

Please sign in to comment.