Skip to content

Commit

Permalink
Merge pull request #189 from pietrocaselani/deploy_fixes
Browse files Browse the repository at this point in the history
Deploy fixes
  • Loading branch information
pietrocaselani committed May 3, 2019
2 parents 98e457d + cae2e57 commit 29f949c
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 70 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- run:
name: Build and run tests
command: bundle exec fastlane lint
- run:
name: Codecov
command: bash <(curl -s https://codecov.io/bash)
# Collect XML test results data to show in the UI,
# and save the same XML files under test-results folder
# in the Artifacts tab
Expand Down
45 changes: 5 additions & 40 deletions CouchTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2431,15 +2431,13 @@
buildConfigurationList = 647632561F44824900F277F1 /* Build configuration list for PBXNativeTarget "CouchTracker" */;
buildPhases = (
EB6C6EE4FCE9F4239E708FE0 /* [CP] Check Pods Manifest.lock */,
829D3A12227A24D8000D24FB /* Export environment variables */,
647632351F44824900F277F1 /* Sources */,
647632361F44824900F277F1 /* Frameworks */,
647632371F44824900F277F1 /* Resources */,
6455BA751F45B862000660C6 /* SwiftLint */,
6405CA021F549BE90039D6E6 /* Embed Frameworks */,
4FAC4A93210F28310096BCE0 /* SwiftFormat */,
303657ACD85152B4015403F8 /* [CP] Embed Pods Frameworks */,
8214A3102279004000FD78F4 /* Crashlytics */,
);
buildRules = (
);
Expand Down Expand Up @@ -2810,6 +2808,7 @@
"${BUILT_PRODUCTS_DIR}/Trakt-iOS/TraktSwift.framework",
"${BUILT_PRODUCTS_DIR}/ActionSheetPicker-3.0/ActionSheetPicker_3_0.framework",
"${BUILT_PRODUCTS_DIR}/AutoInsetter/AutoInsetter.framework",
"${BUILT_PRODUCTS_DIR}/Bugsnag/Bugsnag.framework",
"${BUILT_PRODUCTS_DIR}/Cartography/Cartography.framework",
"${BUILT_PRODUCTS_DIR}/Differentiator/Differentiator.framework",
"${BUILT_PRODUCTS_DIR}/Kingfisher/Kingfisher.framework",
Expand Down Expand Up @@ -2837,6 +2836,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TraktSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ActionSheetPicker_3_0.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AutoInsetter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Bugsnag.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cartography.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Differentiator.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Kingfisher.framework",
Expand Down Expand Up @@ -2932,49 +2932,12 @@
outputFileListPaths = (
);
outputPaths = (
"$SRCROOT/GeneratedFiles/R.generated.swift",
$SRCROOT/GeneratedFiles/R.generated.swift,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$PODS_ROOT/R.swift/rswift\" generate \"$SRCROOT/GeneratedFiles/R.generated.swift\"\n";
};
8214A3102279004000FD78F4 /* Crashlytics */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",
);
name = Crashlytics;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "${PODS_ROOT}/Fabric/run \"${CRASHLYTICS_API_KEY}\" \"${CRASHLYTICS_API_SECRET}\"\n";
};
829D3A12227A24D8000D24FB /* Export environment variables */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Export environment variables";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export CRASHLYTICS_API_KEY=$(cat $SRCROOT/build_phases/crashlytics.apikey)\nexport CRASHLYTICS_API_SECRET=$(cat $SRCROOT/build_phases/crashlytics.apisecret)\n";
};
9C6F0D2340CF87135C62A2BE /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -4036,6 +3999,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = B5RPM7SE3L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = CouchTracker/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -4058,6 +4022,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = B5RPM7SE3L;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = CouchTracker/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
2 changes: 2 additions & 0 deletions CouchTracker/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions CouchTrackerApp/Core/CrashReporter.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Crashlytics
import Bugsnag

public enum CrashReporter {
public static func initialize() {
Crashlytics.start(withAPIKey: Secrets.Crashlytics.apiKey)
Bugsnag.start(withApiKey: Secrets.Bugsnag.apiKey)
}
}
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ source 'https://rubygems.org'
gem 'cocoapods', '1.5.3'
gem 'fastlane', '2.121.1'
gem 'slather', '2.4.6'

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ GEM
xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-bugsnag (1.4.1)
git
xml-simple
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.5.0)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.5, < 0.7.0)
Expand Down Expand Up @@ -210,13 +214,15 @@ GEM
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
xml-simple (1.1.5)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.5.3)
fastlane (= 2.121.1)
fastlane-plugin-bugsnag
slather (= 2.4.6)

BUNDLED WITH
Expand Down
3 changes: 1 addition & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def ios_pods
pod 'Tabman', '2.1.4'
pod 'Cartography', '3.1.0'
pod 'RxDataSources', '3.1.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'Bugsnag'
end

def persistence_pods
Expand Down
15 changes: 5 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ PODS:
- ActionSheetPicker-3.0 (2.2.0)
- Alamofire (4.8.0)
- AutoInsetter (1.5.1)
- Bugsnag (5.20.0)
- Cartography (3.1.0)
- Crashlytics (3.12.0):
- Fabric (~> 1.9.0)
- Differentiator (3.1.0)
- Fabric (1.9.0)
- Kingfisher (5.0.1)
- Moya/Core (12.0.1):
- Alamofire (~> 4.1)
Expand Down Expand Up @@ -57,9 +55,8 @@ PODS:

DEPENDENCIES:
- ActionSheetPicker-3.0 (= 2.2.0)
- Bugsnag
- Cartography (= 3.1.0)
- Crashlytics
- Fabric
- Kingfisher (= 5.0.1)
- Nimble (= 7.3.1)
- NonEmpty (= 0.1.2)
Expand All @@ -80,10 +77,9 @@ SPEC REPOS:
- ActionSheetPicker-3.0
- Alamofire
- AutoInsetter
- Bugsnag
- Cartography
- Crashlytics
- Differentiator
- Fabric
- Kingfisher
- Moya
- Nimble
Expand Down Expand Up @@ -115,10 +111,9 @@ SPEC CHECKSUMS:
ActionSheetPicker-3.0: d11a4c12c6aaf704b8a3f56d179198c99f3e41e6
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
AutoInsetter: 249b103e316d5a9f2c7b88193e966f59bc1aa7b2
Bugsnag: 004de6246295afd742093871d10ebaede63aa02c
Cartography: 1988b7578871a56c036e7af17195cb2190edf18c
Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933
Differentiator: be49ca3408f0ecfc761e4c7763d20c62be01b9ad
Fabric: f988e33c97f08930a413e08123064d2e5f68d655
Kingfisher: 4f771421b9208185217550528a06fd48756cb7c2
Moya: cf730b3cd9e005401ef37a85143aa141a12fd38f
Nimble: 04f732da099ea4d153122aec8c2a88fd0c7219ae
Expand All @@ -141,6 +136,6 @@ SPEC CHECKSUMS:
Trakt: 98bf8f1ef173603deff3a4c0eeda818522529bb6
TVDB: 02147961f77ddc25989b72bff5746e3da78ffb3d

PODFILE CHECKSUM: b7b34d46bf178a106ac5c6da047594a3135e25e5
PODFILE CHECKSUM: 57e6c4296d465c5f8334c501070520012a3cfa0f

COCOAPODS: 1.5.3
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum Secrets {
static let apiKey = ""
}

enum Crashlytics {
enum Bugsnag {
static let apiKey = ""
}
}
Expand Down
18 changes: 15 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ platform :ios do

changelog = get_changelog_as_markdown
test_flight_changelog = get_changelog_clean
new_build_number = increment_build_number

bump_build_number

version_number = get_version_number(target: 'CouchTracker')
new_build_number = get_build_number

bump_and_commit(
commit_new_build_number_and_changelog(
build_number: new_build_number,
version_number: version_number,
changelog: changelog
Expand All @@ -68,6 +71,8 @@ platform :ios do
export_method: 'app-store'
)

upload_symbols_to_bugsnag

publish_to_github(
build_number: new_build_number,
version_number: version_number,
Expand All @@ -93,7 +98,14 @@ platform :ios do
`git log #{tag}...HEAD --pretty=format:"#{log_format}"`.chomp ||= ''
end

private_lane :bump_and_commit do |options|
private_lane :bump_build_number do |_options|
version = get_version_number(target: 'CouchTracker')
lastest_build = latest_testflight_build_number(version: version)
new_build_number = lastest_build + 1
increment_build_number(build_number: new_build_number)
end

private_lane :commit_new_build_number_and_changelog do |options|
new_build_number = options[:build_number]
changelog = options[:changelog]

Expand Down
5 changes: 5 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-bugsnag'
14 changes: 2 additions & 12 deletions scripts/generate_secrets
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
SCRIPT_DIR=$(echo "${BASH_SOURCE[0]}" | xargs dirname | xargs -I % sh -c 'cd % && pwd')
PROJECT_ROOT="${SCRIPT_DIR}/.."
SECRETS_FILE="${PROJECT_ROOT}/CouchTrackerApp/Utils/Secrets.swift"
CRASHLYTICS_API_KEY_FILE="${PROJECT_ROOT}/build_phases/crashlytics.apikey"
CRASHLYTICS_API_SECRET_FILE="${PROJECT_ROOT}/build_phases/crashlytics.apisecret"

cat > "$SECRETS_FILE" << EOF
enum Secrets {
Expand All @@ -22,16 +20,8 @@ enum Secrets {
static let apiKey = "${COUCH_TRACKER_TVDB_API_KEY}"
}
enum Crashlytics {
static let apiKey = "${CRASHLYTICS_API_KEY}"
enum Bugsnag {
static let apiKey = "${BUGSNAG_API_KEY}"
}
}
EOF

cat > "${CRASHLYTICS_API_KEY_FILE}" << EOF
$CRASHLYTICS_API_KEY
EOF

cat > "${CRASHLYTICS_API_SECRET_FILE}" << EOF
$CRASHLYTICS_API_SECRET
EOF

0 comments on commit 29f949c

Please sign in to comment.