Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Publish nightly build #8337

Merged
merged 1 commit into from
Mar 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Added a `MGLDistanceFormatter` class for formatting geographic distances. ([#7888](https://github.com/mapbox/mapbox-gl-native/pull/7888))
* Fixed an issue that was causing the system location indicator to stay on in background after telemetry was disabled. ([#7833](https://github.com/mapbox/mapbox-gl-native/pull/7833))
* Added support for predicates in rendered feature querying [8256](https://github.com/mapbox/mapbox-gl-native/pull/8246)
* Added a nightly build of the dynamic framework. ([#8337](https://github.com/mapbox/mapbox-gl-native/pull/8337))

## 3.4.2 - February 21, 2017

Expand Down
14 changes: 13 additions & 1 deletion platform/ios/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Mapbox.framework/strip-fra

(The last step, courtesy of [Realm](https://github.com/realm/realm-cocoa/), is required for working around an [iOS App Store bug](http://www.openradar.me/radar?id=6409498411401216) when archiving universal binaries.)

##### Nightly builds

A nightly build of the dynamic framework, based on the master branch, is available for download [here](https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-nightly-dynamic.zip).

#### Static framework

You can alternatively install the SDK as a static framework:
Expand Down Expand Up @@ -82,7 +86,15 @@ You can alternatively install the SDK as a static framework:
To test pre-releases and/or betas, you can reference the pre-release like so in your Podfile:

```rb
pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/ios/Mapbox-iOS-SDK.podspec'
pod 'Mapbox-iOS-SDK', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/<insert branch or tag>/platform/ios/Mapbox-iOS-SDK.podspec'
```

##### Testing nightly releases with CocoaPods

To test a nightly dynamic framework build, update your app’s `Podfile` to point to:

```rb
pod 'Mapbox-iOS-SDK-nightly-dynamic', podspec: 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec'
```

##### Using your own build with CocoaPods
Expand Down
30 changes: 30 additions & 0 deletions platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Pod::Spec.new do |m|

version = '3.5.0-beta.2'

m.name = 'Mapbox-iOS-SDK-nightly-dynamic'
m.version = "#{version}-nightly"

m.summary = 'Open source vector map solution for iOS with full styling capabilities.'
m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.'
m.homepage = 'https://www.mapbox.com/ios-sdk/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => 'mobile@mapbox.com' }
m.screenshot = "https://www.mapbox.com/ios-sdk/api/#{version}/img/screenshot.png"
m.social_media_url = 'https://twitter.com/mapbox'
m.documentation_url = 'https://www.mapbox.com/ios-sdk/api/'

m.source = {
:http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-nightly-dynamic.zip",
:flatten => true
}

m.platform = :ios
m.ios.deployment_target = '8.0'

m.requires_arc = true

m.vendored_frameworks = 'dynamic/Mapbox.framework'
m.module_name = 'Mapbox'

end
1 change: 1 addition & 0 deletions platform/ios/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ workflows:
export FORMAT=dynamic
make ipackage-strip
CLOUDWATCH=true platform/ios/scripts/metrics.sh
platform/ios/scripts/deploy-nightly.sh
- is_debug: 'yes'
20 changes: 20 additions & 0 deletions platform/ios/scripts/deploy-nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -e
set -o pipefail
set -u

function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
trap finish EXIT

export TRAVIS_REPO_SLUG=mapbox-gl-native

DATE=`date +%Y-%m-%d`
NIGHTLY_TYPE="nightly-dynamic"

step "Uploading ${NIGHTLY_TYPE} build for ${DATE} to s3…"

./platform/ios/scripts/publish.sh "${NIGHTLY_TYPE}" "${DATE}"

step "Finished deploying ${NIGHTLY_TYPE} build in $(($SECONDS / 60)) minutes and $(($SECONDS % 60)) seconds"
15 changes: 13 additions & 2 deletions platform/ios/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi
# zip
#
cd build/ios/pkg
ZIP=mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip
ZIP="mapbox-ios-sdk-${PUBLISH_VERSION}${PUBLISH_STYLE}.zip"
step "Compressing ${ZIP}…"
rm -f ../${ZIP}
zip -r ../${ZIP} *
Expand All @@ -35,4 +35,15 @@ zip -r ../${ZIP} *
step "Uploading ${ZIP} to s3…"
REPO_NAME=$(basename $TRAVIS_REPO_SLUG)
aws s3 cp ../${ZIP} s3://mapbox/$REPO_NAME/ios/builds/ --acl public-read
echo http://mapbox.s3.amazonaws.com/$REPO_NAME/ios/builds/${ZIP}
echo "URL: https://mapbox.s3.amazonaws.com/$REPO_NAME/ios/builds/${ZIP}"

#
# update nightly
#
if [[ ${PUBLISH_VERSION} =~ "nightly" ]]; then
step "Updating ${PUBLISH_VERSION} to ${PUBLISH_STYLE}…"
GENERIC_NIGHTLY_FILENAME="mapbox-ios-sdk-${PUBLISH_VERSION}.zip"
aws s3 cp \
s3://mapbox/$REPO_NAME/ios/builds/${ZIP} \
s3://mapbox/$REPO_NAME/ios/builds/${GENERIC_NIGHTLY_FILENAME} --acl public-read
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of copying over, can we create a link on S3 that points to the most recent version?

Copy link
Contributor Author

@friedbunny friedbunny Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far as I can tell, s3 doesn’t support symlinks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object-level redirects look like they're perfectly suited for this too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it may be possible to create a placeholder file and then the s3 API could be used here to set up a redirect to the latest version by updating the metadata of the placeholder with x-amz-website-redirect-location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be ideal — I’ll look into setting up a redirect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn’t make redirects work — we’re not strictly a “website” and aws is simply passing the x-amz-website-redirect-location header in GET requests, returning HTTP 200 and a blank file instead of HTTP 301 and the redirected file.

$ aws s3api put-object --bucket mapbox --key mapbox-gl-native/ios/builds/mapbox-ios-sdk-nightly-dynamic.zip --acl public-read --website-redirect-location /mapbox-ios-sdk-nightly-dynamic-2017-03-09.zip
$ curl -I -L https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-nightly-dynamic.zip 
HTTP/1.1 200 OK
x-amz-id-2: Ub2UZ8qnAymsFa8eQUxPQZakb9Pwfb1TspVyl1kvulVT32uN6oZZMv2pO13eKiA9B5yPoxQMSig=
x-amz-request-id: A66C36AF51BB9C8E
Date: Fri, 10 Mar 2017 20:50:27 GMT
Last-Modified: Fri, 10 Mar 2017 20:50:23 GMT
ETag: "d41d8cd98f00b204e9800998ecf8427e"
x-amz-website-redirect-location: /mapbox-ios-sdk-nightly-dynamic-2017-03-09.zip
Accept-Ranges: bytes
Content-Type: application/zip
Content-Length: 0
Server: AmazonS3

Copy link
Contributor Author

@friedbunny friedbunny Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, HTTP 200 appears to be the intended behavior for this endpoint, per this thread:

The redirection functionality is only available for S3 static websites, which unfortunately means that you are seeing the intended behavior. A request served via the usual S3 endpoint will result in a response with the x-amz-website-redirect-location header, while the S3 website endpoint returns an HTTP redirect. Changing the origin to mybucketname.s3-website-us-east-1.amazonaws.com instead of using the bucket directly can theoretically solve the problem.

Hitting a website endpoint confirms we’re not set up as a website on s3. Configuring this bucket as a static website is more than I want to do to get this redirect working.

fi