Skip to content

Commit

Permalink
Add more info to version number
Browse files Browse the repository at this point in the history
See #74
  • Loading branch information
ftassi committed Aug 7, 2016
1 parent 54c3730 commit f62da57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion box.json
Expand Up @@ -24,7 +24,7 @@
"in": "vendor"
}
],
"git-commit": "package_version",
"git-tag": "package_version",
"git-version": "git-version",
"datetime": "release_date",
"main": "bin\/idx",
Expand Down
11 changes: 5 additions & 6 deletions idxfile.php
Expand Up @@ -19,13 +19,12 @@ function deployPhar(\Idephix\IdephixInterface $idx)
exit(0);
}

$currentHash = file_get_contents(
$currentTag = file_get_contents(
'https://raw.githubusercontent.com/ideatosrl/getidephix.com/gh-pages/version'
);
$newVersion = $idx->local('git rev-parse HEAD');

if ($newVersion == $currentHash) {
$idx->output()->writeln("version $newVersion already deployed");
if ($newTag == $currentTag) {
$idx->output()->writeln("version $newTag already deployed");
exit(0);
}

Expand All @@ -43,11 +42,11 @@ function deployPhar(\Idephix\IdephixInterface $idx)
$idx->local('cp -f idephix.phar ~/docs');
$idx->local('mkdir -p ~/docs/archive');
$idx->local("cp -f idephix.phar ~/docs/archive/idephix-{$newTag}.phar");
$idx->local('git rev-parse HEAD > ~/docs/version');
$idx->local("echo $newTag > ~/docs/version");
$idx->local('cd ~/docs && git status');

$idx->local('cd ~/docs && git add -A .');
$idx->local("cd ~/docs && git commit -m 'deploy phar version $newTag $newVersion'");
$idx->local("cd ~/docs && git commit -m 'deploy phar version $newTag'");
$idx->local('cd ~/docs && git push -q origin gh-pages');
};

Expand Down

0 comments on commit f62da57

Please sign in to comment.