-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.php
49 lines (36 loc) · 954 Bytes
/
build.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/***
* DustinGraham.com Deploy Script
* - Checks ftp for current version
* - "Exports" changes from SVN
* - Uploads via ftp and updates version file with latest SVN version.
*
*/
$config = require('config.php');
require('classes/svn.php');
require('classes/ftp.php');
require('classes/filesystem.php');
$fs = new FileSystem($config);
$svn = new Svn($fs, $config);
$ftp = new Ftp($fs, $config);
$rVer = $ftp->getCurrentVersion();
$sVer = $svn->getCurrentVersion();
if ($config['debug'])
{
var_dump($rVer, $sVer, $config);
exit;
}
if ($sVer > $rVer)
{
$changes = $svn->checkoutChanges($rVer);
echo "\r\n\r\n[ Found " . (count($changes)) . " changes to upload. ]\r\n\r\n";
// Create a .ver file
$fs->addSvnVersion($sVer);
$changes[] = $config['svn_subfolder'].$config['version_file'];
$ftp->putChanges($changes);
}
else
{
echo "\r\n -= Up to date =-";
}
$fs->removeTempFolder();