Created
May 31, 2018 19:57
-
-
Save Snaver/285aec0b6fa81fda1995716ae0774ec3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Laravel pipelines https://confluence.atlassian.com/bitbucket/laravel-with-bitbucket-pipelines-913473967.html | |
# | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
#image: php:7.1.1 | |
# Bitbucket Pipelines now includes the option to allocate additional resources. | |
# By specifying the size of '2x', your pipeline will include double the resources (eg. 4GB memory → 8GB memory). | |
#options: | |
# size: 2x | |
pipelines: | |
branches: | |
master: | |
- step: | |
name: Envoy Run | |
image: | |
name: mcuyar/docker-envoy | |
script: | |
- envoy run exampleCommands --host=$HOST --user=$USER --php=php --code_directory=$BITBUCKET_CLONE_DIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@servers(['web' => $user.'@'.$host,'localhost' => '127.0.0.1']) | |
@setup | |
// Sanity checks | |
if (empty($host)) { | |
exit('ERROR: $host var empty or not defined'); | |
} | |
if (empty($user)) { | |
exit('ERROR: $user var empty or not defined'); | |
} | |
if (empty($php)) { | |
exit('ERROR: $php var empty or not defined'); | |
} | |
if (empty($code_directory)) { | |
exit('ERROR: $code_directory var empty or not defined'); | |
} | |
// Command or path to invoke PHP | |
$php = empty($php) ? 'php' : $php; | |
@endsetup | |
@story('exampleCommands') | |
pipeline_task | |
server_task | |
@endstory | |
@task('pipeline_task', ['on' => 'localhost']) | |
echo "* Running example command on the Bitbucket Pipeline server *" | |
hostname | |
ls -la | |
ls -la {{ $code_directory }} | |
@endtask | |
@task('server_task', ['on' => 'web']) | |
echo "* Running example command on the remote server *" | |
hostname | |
ls -la | |
@endtask |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment