Skip to content

Instantly share code, notes, and snippets.

@MaartenGDev
Created September 29, 2016 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaartenGDev/8382a78e62a3a866b17cc48a00c7aa60 to your computer and use it in GitHub Desktop.
Save MaartenGDev/8382a78e62a3a866b17cc48a00c7aa60 to your computer and use it in GitHub Desktop.
Deploy script for php
<?php
$directory = '/var/www/ci.maartendev.me/';
if(isset($_GET['key']) && $_GET['key'] == 'c3fd698fb41a45secure6b66644d9445duji'){
$gitCommands= [
"git -C {$directory} pull",
"composer install -d {$directory}"
];
foreach($gitCommands as $command){
echo shell_exec($command) . "\n";
}
}else{
echo "error logged\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment