Created
March 20, 2012 20:26
-
-
Save jimbojsb/2140944 to your computer and use it in GitHub Desktop.
Bamboo is dead, long live bamboo
This file contains 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
<?php | |
chdir("/home/offers/www/offers-qa/coral"); | |
`git checkout next`; | |
`git reset --hard HEAD`; | |
`git pull`; | |
chdir("/home/offers/www/offers-qa/orca"); | |
`git checkout next`; | |
`git reset --hard HEAD`; | |
`git pull`; | |
$date = `git log --max-count=1 | grep Date`; | |
$date = trim(str_replace('Date:', '', $date)); | |
$timestamp = strtotime($date); | |
$lastrun = trim(@file_get_contents('/home/offers/www/offers-qa/lastbuild')) ?: 0; | |
echo $timestamp . " : " . $lastrun . PHP_EOL; | |
if ($timestamp > $lastrun && !file_exists("/home/offers/www/offers-qa/building")) { | |
touch("/home/offers/www/offers-qa/building"); | |
file_put_contents('/home/offers/www/offers-qa/lastbuild', time()); | |
chdir("/home/offers/www/offers-qa/orca/build"); | |
copy("/home/offers/www/offers-qa/build.properties", "/home/offers/www/offers-qa/orca/build/build.properties"); | |
copy("/home/offers/www/offers-qa/keys.xml", "/home/offers/www/offers-qa/orca/keys.xml"); | |
$log = `APPLICATION_ENV=qa /usr/bin/env phing build-qa 2>&1`; | |
echo $log; | |
file_put_contents("/home/offers/www/offers-qa/buildlog", $log); | |
unlink("/home/offers/www/offers-qa/building"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment