Skip to content

Commit

Permalink
Minor bugfix for travis caching builds and readme update.
Browse files Browse the repository at this point in the history
  • Loading branch information
virgofx committed Mar 1, 2016
1 parent ae33645 commit e34512e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,7 @@ Composer integration for PHP applications to install the [Phalcon](https://phalc
* Phalcon extension loaded in PHP runtime
* Native cache support to prevent rebuilding Phalcon from source
* Auto-detection of latest tagged Phalcon version
* Install specific Phalcon versions, tags and releases (Since 1.0.2)


### Usage

```bash
# Install latest version from default branch
./bin/install-phalcon.sh

# Install latest revision from branch "2.1.x"
./bin/install-phalcon.sh 2.1.x

# Install specific release tag "phalcon-v2.0.9"
./bin/install-phalcon.sh phalcon-v2.0.9
```
* Install specific Phalcon versions, tags and releases _(Since 1.0.2)_


### Installation
Expand All @@ -47,6 +33,23 @@ Composer integration for PHP applications to install the [Phalcon](https://phalc
relevant section. See the examples below for various CI providers.


### Options

The installer takes one optional argument that can be used to specify a specific branch or tag.

Examples:

```bash
# Install latest version from default branch
./bin/install-phalcon.sh

# Install latest revision from branch "2.1.x"
./bin/install-phalcon.sh 2.1.x

# Install specific release tag "phalcon-v2.0.9"
./bin/install-phalcon.sh phalcon-v2.0.9
```

## CircleCI

**`circle.yml`**
Expand Down
9 changes: 6 additions & 3 deletions bin/install-phalcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ PHP_EXT_DIR=$(php-config --extension-dir)
# Prior to building, attempt to enable phalcon from a cached dependency
# which may have been set via the CI environment YML declaration. This is
# important as it helps improve performance for fast builds.
if [ -d "${PHALCON_DIR}" ]; then
cd ${PHALCON_DIR}

# Note: Travis creates the folder ahead of time so it's important to explicitly
# check for the .git folder to ensure we can perform git operations.
if [ -d "${PHALCON_DIR}" ] && [ -d "${PHALCON_DIR}/.git" ]; then

cd ${PHALCON_DIR}
TMP_PHALCON_SAVED_MODULES_DIR=$(mktemp -d)

# Prior to resetting the current clone, save any previously cached modules.
Expand All @@ -49,7 +52,7 @@ if [ -d "${PHALCON_DIR}" ]; then
# Checkout specific ref
echo "Updating Phalcon to latest revision for ref: ${PHALCON_INSTALL_REF}"
set +e
git checkout ${PHALCON_INSTALL_REF}
git checkout ${PHALCON_INSTALL_REF} &>/dev/null

# This could potentially fail for older versions that had a depth limiter from < 1.0.2 of the installer.
# Handle gracefully and clean the cache automatically.
Expand Down

0 comments on commit e34512e

Please sign in to comment.