https://github.com/appsquickly/backdrop
A utility for configuring iOS and OSX applications for different environments
https://github.com/appsquickly/backdrop
cicd configuration-management environments ios swift
Last synced: 22 days ago
JSON representation
A utility for configuring iOS and OSX applications for different environments
- Host: GitHub
- URL: https://github.com/appsquickly/backdrop
- Owner: appsquickly
- License: apache-2.0
- Created: 2015-10-12T03:25:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-18T03:57:00.000Z (almost 8 years ago)
- Last Synced: 2025-03-26T08:07:13.293Z (about 1 month ago)
- Topics: cicd, configuration-management, environments, ios, swift
- Language: Swift
- Size: 31.3 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Backdrop is a utility for configuring an application's Info.plist file for separate environments. It can be used:
* In dev environments for quickly switching between dev, staging, production environments.
* On continuous integration build servers to automate deployment of pre-configured builds.# How Does it Work?
* We create an `EnvFile.plist` that declares the properties (icon file, TyphoonConfig, CFBundleID, etc) that will be different between each environment.
* We use a cmd-line utility to apply those configurations.Optionally, the cmd-line utility can apply a build number - `CFBundleVersion` - in the format: `..`
# Running
Apply the config named 'staging' in the `EnvFile.plist`, and generate a new version number.
```bash
backdrop.swift --select staging --newVersion
```# Using in CI Environments
Here's how we do it:
* Set up a branch for each environment in git, and set up a Jenkins job to monitor for pushes to those branches.
* Exececute the follow script to build and upload to iTunes Connect(the script below uses Shenzhen to upload the build)
```bash
#!/bin/shproduct_name='AmazingApp'
provisioning_profile='My Store Profile'#Fail immediately if a task fails
set -e
set -o pipefailecho "--- Backing up Info.plist ---"
cp "./$product_name/Supporting Files/Info.plist" "./$product_name/Supporting Files/Info.plist.bak"echo "--- Building ---"
rm -fr ./$product_name.ipa
rm -fr ./$product_name.xcarchive/./backdrop.swift --select production --newVersion
xcodebuild -workspace $product_name.xcworkspace/ -scheme $product_name -destination 'generic/platform=iOS' -archivePath "$product_name.xcarchive" archive | xcpretty
xcodebuild -exportArchive -exportFormat ipa -archivePath "$product_name.xcarchive" -exportPath "$product_name.ipa" -exportProvisioningProfile "$provisioning_profile"
ipa info $product_name.ipaecho "------ Built ------"
rm "./$product_name/Supporting Files/Info.plist"
mv "./$product_name/Supporting Files/Info.plist.bak" "./$product_name/Supporting Files/Info.plist"
./backdrop.swift
```# Installing
Later we'll publish to Brew and MacPorts, but for now, this executable Swift script can be used.
# TODO
1. Make backdrop peform the build and upload to iTunes Connect, rather than use the bash script above.
2. Remove the dependency on Shenzhen ipa distribute task.
3. Add generation of debug symbols and tie in to our (or others?) crash reporters