Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (51 sloc) 1.55 KB
# Execute the pipeline with the wercker/php box
box: wercker/php
build:
steps:
# Install dependencies with composer
- script:
name: install dependencies
code: |-
composer install --no-interaction
# Spin webservice and serve site
- script:
name: Serve application
code: php -S localhost:8000 >> /dev/null &
# Execute integration tests with php unit
- script:
name: PHPUnit integration tests
code: phpunit --configuration phpunit.xml
deploy:
steps:
- add-to-known_hosts:
hostname: $FORTRABBIT_GIT_HOST
- script:
name: Setup git repository
code: |-
# Remove existing git repository if exists
if [ -d ".git" ]; then rm -rf .git; fi
# Configure git user
git config --global user.name "wercker"
git config --global user.email pleasemailus@wercker.com
# Initialize new repository and add everything
git init
git add .
git commit -m 'Deploy commit'
# Add fortrabbit remote
git remote add fortrabbit $FORTRABBIT_GIT_REMOTE
- script:
name: Make .SSH directory
code: mkdir -p "$HOME/.ssh"
- create-file:
name: Write SSH key
filename: $HOME/.ssh/id_rsa
overwrite: true
content: $FORTRABBIT_KEY_PRIVATE
- script:
name: Set permissions for SSH key
code: |-
chmod 0400 $HOME/.ssh/id_rsa
- script:
name: Git push deploy
code: |-
git push fortrabbit master -f