Fix for "git archive" doesn't work in GitLab
This commit is contained in:
parent
49fb1ada43
commit
7a8a901b6d
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
$shortopts = '';
|
$shortopts = '';
|
||||||
$longopts = array(
|
$longopts = array(
|
||||||
@ -23,7 +23,7 @@ Utilisation : <?php echo $argv[0]; ?> {options}
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Variables
|
// --- Variables
|
||||||
$reposPath = "ssh://git@192.168.78.249:10022/SCORES";
|
$reposPath = "ssh://git@gitlab.factory.insight.doubletrade.com:scores";
|
||||||
$exportPath = '/home/vhosts/deploy/export';
|
$exportPath = '/home/vhosts/deploy/export';
|
||||||
|
|
||||||
define('COMPOSER_HOME', '/home/vhosts/deploy/composer');
|
define('COMPOSER_HOME', '/home/vhosts/deploy/composer');
|
||||||
@ -50,9 +50,18 @@ if (file_exists($exportPath.'/'.$archiveProjet)) {
|
|||||||
if (file_exists($exportPath.'/'.$projet.'.tar')) {
|
if (file_exists($exportPath.'/'.$projet.'.tar')) {
|
||||||
passthru('rm -rf '.$exportPath.'/'.$projet.'.tar');
|
passthru('rm -rf '.$exportPath.'/'.$projet.'.tar');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Git Archive
|
||||||
|
/*
|
||||||
passthru('git archive --remote='.$reposPath.'/'.$projet.'.git --prefix='.$archiveProjet.'/ -o '.
|
passthru('git archive --remote='.$reposPath.'/'.$projet.'.git --prefix='.$archiveProjet.'/ -o '.
|
||||||
$exportPath.'/'.$projet.'.tar '.$version);
|
$exportPath.'/'.$projet.'.tar '.$version);
|
||||||
passthru('tar -xf '.$exportPath.'/'.$projet.'.tar --directory='.$exportPath);
|
passthru('tar -xf '.$exportPath.'/'.$projet.'.tar --directory='.$exportPath);
|
||||||
|
passthru('rm -rf '.$exportPath.'/'.$projet.'.tar');
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Git clone - because GitLab doesn't support 'git archive'
|
||||||
|
passthru('git clone -q -b '.$version.' '.$reposPath.'/'.$projet.'.git '.$exportPath.'/'.$archiveProjet);
|
||||||
|
passthru('rm -rf '.$exportPath.'/'.$archiveProjet.'/.git');
|
||||||
if (!file_exists($exportPath.'/'.$archiveProjet)) {
|
if (!file_exists($exportPath.'/'.$archiveProjet)) {
|
||||||
echo "Erreur\n";
|
echo "Erreur\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -70,7 +79,6 @@ if (file_exists($exportPath.'/'.$archiveProjet.'/composer.lock')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
passthru('rm -rf '.$exportPath.'/'.$projet.'.tar');
|
|
||||||
// --- Deploiement, pas de compression
|
// --- Deploiement, pas de compression
|
||||||
if (array_key_exists('deploy', $options)) {
|
if (array_key_exists('deploy', $options)) {
|
||||||
passthru('rm -rf '.$exportPath.'/'.$archiveProjet);
|
passthru('rm -rf '.$exportPath.'/'.$archiveProjet);
|
||||||
|
Loading…
Reference in New Issue
Block a user