Commit 4d4b8908 authored by Felix Flor's avatar Felix Flor

Merge branch 'v2.2.3' into 'master'

V2.2.3

See merge request code-mesa/aphpbreakdown!14
parents ab58a181 4967d7c3
# PHP Storm Directory
.idea
ciItegrationCheck.php
/test_dir/
\ No newline at end of file
/test_dir/
version.inc.php
aphpbreakdown.phar
\ No newline at end of file
......@@ -4,6 +4,7 @@ before_script:
stages:
- build
- deploy
- post_deploy
build_phar:
artifacts:
......@@ -29,5 +30,45 @@ deploying:
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- rsync -rpvu --progress ./aphpbreakdown-*.phar $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
- rsync -rpvu --progress ./aphpbreakdown-*.phar $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PHAR_PATH
- killall ssh-agent
deploy_version:
stage: deploy
only:
- tags
tags:
- rsync
script:
- if [ -f ./latest.php ]; then
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- rsync -rpvu --progress ./latest.php $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_VERSION_PATH
- killall ssh-agent
- fi
deploy_changelog:
stage: deploy
only:
- tags
tags:
- rsync
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- rsync -rpvu --progress ./CHANGELOG.md $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_VERSION_PATH
- killall ssh-agent
build_symlink:
stage: post_deploy
only:
- tags
tags:
- rsync
script:
- if [ -f ./latest.php ]; then
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- ssh $DEPLOY_USER@$DEPLOY_HOST "ln -s -f "$DEPLOY_PHAR_PATH"autopim-"$CI_COMMIT_TAG".phar "$DEPLOY_PHAR_PATH"autopim.phar"
- killall ssh-agent
- fi
# Changelog
## 2.2.3
**NEW**
- New build process
- Added Version output
## 2.2.2
**CHANGED**
......
......@@ -29,7 +29,7 @@ here are some different examples for different results:
## Requirements
- installation of php 5.6 and above with command line interface (cli)
- needed php 5.6 modules
- needed php 5.6 and above modules
- tokenizer
- phar
- hash
......@@ -42,18 +42,18 @@ here are some different examples for different results:
## Hot To install
# download the aphpbreakdown.phar
wget http://phar.code-mesa.com/aphpbreakdown-2.2.2.phar
wget https://dl.pimlab.de/aphpbreakdown/aphpbreakdown.phar
# alternativ download way
fetch http://phar.code-mesa.com/aphpbreakdown-2.2.2.phar
# alternativ download way
fetch https://dl.pimlab.de/aphpbreakdown/aphpbreakdown.phar
# make it executable
chmod +x aphpbreakdown-2.2.2.phar
chmod +x aphpbreakdown.phar
# copy it to you binary directory
# linux
sudo cp aphpbreakdown-2.2.2.phar /usr/local/bin/aphpbreakdown
sudo cp aphpbreakdown.phar /usr/local/bin/aphpbreakdown
# unix
# with root privileges
......
......@@ -27,6 +27,8 @@ if(\file_exists($ignoredModulesFile) && \is_readable($ignoredModulesFile)){
system("clear");
echo "Version ".VERSION." from ".BUILD_DATE;
switch($argv[2]){
case "--console-basic":
basicConsoleOutput($filesToCheck);
......
......@@ -4,11 +4,53 @@
* Building the PHAR.
*/
$objPhar = new \Phar('aphpbreakdown.phar', 0, 'aphpbreakdown.phar');
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
require_once __DIR__ . '/constants.inc.php';
/***********************************************/
/* Build Version File for Online-Version-Check */
/***********************************************/
$latesVersionFile = 'latest.php';
if(!empty($argv[1])){
$options = array(CURLOPT_URL => VERSION_URL,
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 20,
CURLOPT_TIMEOUT => 30);
$handler = curl_init();
curl_setopt_array($handler, $options);
$result = curl_exec($handler);
echo "\nOC-Version: $result\nBuild-Bersion: ".$argv[1];
if(version_compare($result, $argv[1], '<') && 0 == curl_errno($handler)){
echo "\nBuild new latest Version File\n";
file_put_contents($latesVersionFile, "<?php\n\nexit('".$argv[1]."');");
} else {
echo "\nBuild NO new latest Version File.\n";
if(0 != curl_errno($handler))
echo "cURL-Error: ".curl_error($handler)."\n";
}
}
/********************************************************************/
/* Pre Build Process to build the Version-File including in Autopim */
/********************************************************************/
$versionFile = 'version.inc.php';
(!empty($argv[1])) ? $version = $argv[1] : $version = 'unknown' ;
unlink($versionFile);
echo "\nBuild new Version File to include it to PHAR-File\n";
file_put_contents($versionFile, "<?php\n\nnamespace APHPBreakdown;\n\n", FILE_APPEND | LOCK_EX);
file_put_contents($versionFile, "define('VERSION', '".$version."');\n", FILE_APPEND | LOCK_EX);
file_put_contents($versionFile, "define('BUILD_DATE', '".date('Y-m-d H:i:s')."');\n", FILE_APPEND | LOCK_EX);
/**********************************/
/* Build Process of the PHAR File */
/**********************************/
echo "\nBuild new PHAR File to include it to PHAR-File\n\n";
$objPhar = new \Phar('aphpbreakdown.phar', 0, 'aphpbreakdown.phar');
$objPhar->addFile('autoanalyse.php');
$objPhar->addFile('config.inc.php');
$objPhar->addFile('constants.inc.php');
$objPhar->addFile($versionFile);
$objPhar->buildFromIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/inc/')),__DIR__);
$objPhar->setStub('#!/usr/bin/env php' . "\n" . $objPhar->createDefaultStub('autoanalyse.php'));
......@@ -4,6 +4,11 @@ namespace APHPBreakdown;
error_reporting(E_ALL & ~E_WARNING & ~E_NOTICE);
/*************************/
/* Constants Definitions */
/*************************/
require_once __DIR__ . '/version.inc.php';
/******************************************************/
/* files which contains arrays used in differen parts */
/******************************************************/
......
<?php
namespace APHPBreakdown;
define("VERSION_URL", "http://vc.pimlab.de/aphpbreakdown/latest.php");
\ No newline at end of file
<?php
exit('2.2.3');
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment