forked from markomarkovic/simple-php-git-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65623d6
commit 1c9244c
Showing
2 changed files
with
140 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
/** | ||
* Deployment configuration | ||
* | ||
* It's preferable to configure the script using this file istead of directly. | ||
* | ||
* Rename this file to `deploy-config.php` and edit the | ||
* configuration options here instead of directly in `deploy.php`. | ||
* That way, you won't have to edit the configuration again if you download the | ||
* new version of `deploy.php`. | ||
*/ | ||
|
||
/** | ||
* Protect the script from unauthorized access by using a secret access token. | ||
* If it's not present in the access URL as a GET variable named `sat` | ||
* e.g. deploy.php?sat=Bett...s the script is not going to deploy. | ||
* | ||
* @var string | ||
*/ | ||
define('SECRET_ACCESS_TOKEN', 'BetterChangeMeNowOrSufferTheConsequences'); | ||
|
||
/** | ||
* The address of the remote Git repository that contains the code that's being | ||
* deployed. | ||
* If the repository is private, you'll need to use the SSH address. | ||
* | ||
* @var string | ||
*/ | ||
define('REMOTE_REPOSITORY', 'https://github.com/markomarkovic/simple-php-git-deploy.git'); | ||
|
||
/** | ||
* The branch that's being deployed. | ||
* Must be present in the remote repository. | ||
* | ||
* @var string | ||
*/ | ||
define('BRANCH', 'master'); | ||
|
||
/** | ||
* The location that the code is going to be deployed to. | ||
* Don't forget the trailing slash! | ||
* | ||
* @var string Full path including the trailing slash | ||
*/ | ||
define('TARGET_DIR', '/tmp/simple-php-git-deploy/'); | ||
|
||
/** | ||
* Weather to delete the files that are not in the repository but are on the | ||
* local (server) machine. | ||
* | ||
* !!! WARNING !!! This can lead to a serious loss of data if you're not | ||
* careful. All files that are not in the repository are going to be deleted, | ||
* except the ones defined in EXCLUDE section and the ones listed in .gitignore | ||
* if EXCLUDE_GITIGNORE is set to true! | ||
* BE CAREFUL! | ||
* | ||
* @var boolean | ||
*/ | ||
define('DELETE_FILES', false); | ||
|
||
/** | ||
* The directories and files that are to be excluded when updating the code. | ||
* Normally, these are the directories containing files that are not part of | ||
* code base, for example user uploads or server-specific configuration files. | ||
* Use rsync exclude pattern syntax for each element. | ||
* | ||
* @var serialized array of strings | ||
*/ | ||
define('EXCLUDE', serialize(array( | ||
'.git', | ||
'webroot/uploads', | ||
'app/config/database.php', | ||
))); | ||
|
||
/** | ||
* Weather to exclude all files and directories listed in .gitignore. | ||
* Only the .gitignore file in the project root directory is going to be used. | ||
* | ||
* @var boolean | ||
*/ | ||
define('EXCLUDE_GITIGNORE', false); | ||
|
||
/** | ||
* Temporary directory we'll use to stage the code before the update. If it | ||
* already exists, script assumes that it contains an already cloned copy of the | ||
* repository with the correct remote origin and only fetches changes instead of | ||
* cloning the entire thing. | ||
* | ||
* @var string Full path including the trailing slash | ||
*/ | ||
define('TMP_DIR', '/tmp/spgd-'.md5(REMOTE_REPOSITORY).'/'); | ||
|
||
/** | ||
* Weather to remove the TMP_DIR after the deployment. | ||
* It's useful NOT to clean up in order to only fetch changes on the next | ||
* deployment. | ||
*/ | ||
define('CLEAN_UP', true); | ||
|
||
/** | ||
* Output the version of the deployed code. | ||
* | ||
* @var string Full path to the file name | ||
*/ | ||
define('VERSION_FILE', TMP_DIR.'VERSION.txt'); | ||
|
||
/** | ||
* Time limit for each command. | ||
* | ||
* @var int Time in seconds | ||
*/ | ||
define('TIME_LIMIT', 30); | ||
|
||
/** | ||
* OPTIONAL | ||
* Backup the TARGET_DIR into BACKUP_DIR before deployment | ||
* | ||
* @var string Full backup directory path e.g. '/tmp/' | ||
*/ | ||
define('BACKUP_DIR', false); |
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