Skip to content

Commit

Permalink
Add install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
scenee committed Jan 13, 2017
1 parent 2d0d505 commit 1b7a0cb
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 21 deletions.
51 changes: 30 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ Relax can

# Installation

## Homebrew

```bash
$ brew tap SCENEE/homebrew-formulae
$ brew install relax
```

## Install script

```bash
$brew tap SCENEE/homebrew-formulae
$brew install relax
$ curl -fsSL https://raw.githubusercontent.com/SCENEE/relax/master/install.sh | bash
```

# Requirements

Relax must only depend on pre-installed command line tools in macOS and Xcode.
Expand All @@ -48,28 +57,28 @@ NOTE: Relax might be working on Xcode 7.3.1
## Quick start

```bash
cd /path/to/your/project
$ cd /path/to/your/project

# Create a Relfile template
relax init
$ relax init

# Build a xcarchive file
relax archive development
$ relax archive development

# Print a path to a built archive
relax show development archive
$ relax show development archive

# Export an ipa file
relax export development
$ relax export development

# Print a path to a exported ipa file
relax show development ipa
$ relax show development ipa

# Validate the ipa file
relax validate "$(relax show development ipa)"
$ relax validate "$(relax show development ipa)"

# Upload the ipa file (It's necessary to add a token and secret in Relfile)
relax upload crashlytics "$(relax show development ipa)"
$ relax upload crashlytics "$(relax show development ipa)"

```

Expand All @@ -78,7 +87,7 @@ relax upload crashlytics "$(relax show development ipa)"
Run this command and set up each configurations in `Relfile`.

```bash
$relax init
$ relax init
```

An example of Relfile is here.
Expand Down Expand Up @@ -143,7 +152,7 @@ log_formatter: xcpretty
## Build an archive for your product
```bash
$relax -v archive adhoc
$ relax -v archive adhoc
```

`xcodebuild` stdout is always written to a log file.
Expand All @@ -152,38 +161,38 @@ If you would like to print it in your console, please use with '-v' option.
## Export an .ipa file

```bash
$relax export adhoc
$ relax export adhoc
```

You can specify a xcarchive file path after a release type like here.

```bash
$relax export adhoc /path/to/archive
$ relax export adhoc /path/to/archive
```

Relax can export it on a different team and certificate from one signed xcarchive.

## Check the mobileprovision, entitlements and version of an .ipa file

```bash
$relax validate /path/to/SampleApp.ipa
$ relax validate /path/to/SampleApp.ipa
```

## Upload an .ipa file to Crashlytics

```bash
$relax upload crashlytics /path/to/SampleApp.ipa
$ relax upload crashlytics /path/to/SampleApp.ipa
```

## Resign an .ipa file with other provisioning profile and a certificate

```bash
$relax resign -p "<my-provisioning-profile>" -c "iPhone Distribution: <Me>" /path/to/SampleApp.ipa
$ relax resign -p "<my-provisioning-profile>" -c "iPhone Distribution: <Me>" /path/to/SampleApp.ipa
```
## Other commands

```bash
$relax commands
$ relax commands
```

# Relfile
Expand All @@ -203,13 +212,13 @@ development2:
```

```bash
$BUNDLE_SUFFIX=debug relax archive development2
$ BUNDLE_SUFFIX=debug relax archive development2
```
or

```bash
$export BUNDLE_SUFFIX=debug
$relax archive development2
$ export BUNDLE_SUFFIX=debug
$ relax archive development2
```
But you can't use Xcode build setting variables (PRODUCT_NAME etc.) in Relfile.
Because they can be overridden by Relfile's definitions.
Expand Down
41 changes: 41 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash -eu

BLUE='\033[0;34m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
BOLD='\033[1m'
NC='\033[0m'
ARROW="${BLUE}==>${NC}${BOLD}"
WARN="${RED}Warning${NC}${BOLD}"
ERROR="${RED}Error${NC}${BOLD}"

print() {
echo -e "$1${NC}"
}

os_name=$(uname)
dest=~/.relax

print "$ARROW Check xcode-select"
xcode-select -p > /dev/null
if test 0 -ne $?; then
print "==> Run: xcode-select --install"
if xcode-select --install; then
print "$ERROR Please install the command line developer tools as accoording to a user interface dialog"
exit 1
fi
fi

print "$ARROW Fetch relax..."
[[ -d "$dest" ]] && rm -fr "$dest"
git clone https://github.com/SCENEE/relax.git --depth 1 -b master "$dest"
rm -rf "$dest"/sample

print "${BOLD}Done!${NC}"
cat <<-EOM
Add Relax binary path to your bash profile:
export PATH=\$HOME/.relax/bin:\$PATH
To enable completion, add the following to your bash profile:
if which relax > /dev/null; then source "\$(relax init completion)"; fi
EOM

0 comments on commit 1b7a0cb

Please sign in to comment.