Cleaning up build. New repository structure still missing.

This commit is contained in:
Dennis Eichhorn 2015-12-22 19:02:50 +01:00
parent e5a3137812
commit bfd4d5d97b
6 changed files with 67 additions and 60 deletions

View File

@ -30,7 +30,8 @@ find ${ROOT_PATH} -name "*tpl.php" | sed -e :a -re 's/<!--.*?-->//g;/<!--/N;//ba
rm -r -f ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
mkdir -p ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
mkdir -p ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public/jsOMS
mkdir -p ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public/jsOMS/Utils
# todo: build js and css files here!!!
# Copying built files
cp -R ${ROOT_PATH}/Admin/ ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
@ -43,7 +44,7 @@ cp -R ${ROOT_PATH}/Web/ ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
cp -R ${ROOT_PATH}/Socket/ ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
cp -R ${ROOT_PATH}/Console/ ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public
cp ${ROOT_PATH}/jsOMS/oms.min.js ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public/jsOMS
cp ${ROOT_PATH}/jsOMS/Utils/oLib.min.js ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public/jsOMS/Utils
cp ${ROOT_PATH}/jsOMS/Utils/oLib.min.js ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public/jsOMS
# Removing dev files
find ${ROOT_PATH}/${RELEASE_PATH}/${VERSION_HASH}/Public -name "*.scss" -type f -delete

11
demo.sh
View File

@ -1,11 +0,0 @@
#!/bin/bash
. var.sh
. ${ROOT_PATH}/private.sh
# Setting up database for demo and testing
mysql -e 'drop database if exists oms;' -u root -p${DB_PASSWORD}
mysql -e 'create database oms;' -u root -p${DB_PASSWORD}
#echo "USE mysql;\nUPDATE user SET password=PASSWORD('123456') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
curl --connect-timeout 600 --max-time 601 ${WEB_URL}/Admin/Install

View File

@ -1,33 +1,9 @@
#!/bin/bash
# Include private
# Include
. var.sh
. ${ROOT_PATH}/private.sh
# Previous cleanup
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/logs
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/stats
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/docs
# Creating directories
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/logs
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/stats >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/docs >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
# Handling git
cd ${ROOT_PATH} && git fetch --all && git reset --hard origin/${GIT_BRANCH} && git pull >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
# Permission handling
chmod -R 777 ${ROOT_PATH}
# Change path for correct script inclusion
cd ${ROOT_PATH}/${BUILD_PATH}
# Setting up demo
. ${BUILD_PATH}/demo.sh
# Installing tools
. ${BUILD_PATH}/install.sh
. ${ROOT_PATH}/${BUILD_PATH}/setup.sh
# Executing unit tests
php ${ROOT_PATH}/phpunit.phar --configuration ${ROOT_PATH}/${TEST_PATH}/PHPUnit/phpunit_default.xml --coverage-text --coverage-clover ${ROOT_PATH}/${BUILD_PATH}/logs/clover.xml > ${ROOT_PATH}/${BUILD_PATH}/logs/phpunit.log
@ -66,9 +42,6 @@ find ${ROOT_PATH} -name "*.json" | xargs -L1 jsonlint -q > ${ROOT_PATH}/${BUILD_
#curl --get --data api_token=$CODECLIMATE_TOKEN https://codeclimate.com/api/repos/oms/branches/$GIT_BRANCH/refresh -- Coming in the future... right now not available for free
#curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token $TRAVIS_TOKEN" -d '{"request": {"branch":"$GIT_BRANCH"}}' https://api.travis-ci.org/repo/spl1nes%2FOrange-Management/requests
# Mail
#echo "New build of branch $GIT_BRANCH from $GITHUB_URL created." | mail -s "New build" $MAIL_ADDR
# Html tag inspection
TAG[0]="<\/html>"
TAG[1]="<\/body>"

View File

@ -1,16 +0,0 @@
#!/bin/bash
# Downloading tools
wget -nc https://phar.phpunit.de/phploc.phar
wget -nc https://phar.phpunit.de/phpunit.phar
wget -nc https://github.com/Halleck45/PhpMetrics/raw/master/build/phpmetrics.phar
wget -nc http://phpdoc.org/phpDocumentor.phar
wget -nc http://static.pdepend.org/php/latest/pdepend.phar
wget -nc https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget -nc http://static.phpmd.org/php/latest/phpmd.phar
wget -nc https://phar.phpunit.de/phpcpd.phar
wget -nc http://dl.google.com/closure-compiler/compiler-latest.tar.gz
tar -zxvf compiler-latest.tar.gz
# Installing tools
[[ $(jsonlint -h) != *"Usage: jsonlint"* ]] && npm install jsonlint -g

46
setup.sh Normal file
View File

@ -0,0 +1,46 @@
#!/bin/bash
. var.sh
. ${ROOT_PATH}/private.sh
# Previous cleanup
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/logs
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/stats
rm -r -f ${ROOT_PATH}/${BUILD_PATH}/docs
# Creating directories
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/logs
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/stats >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
mkdir -p ${ROOT_PATH}/${BUILD_PATH}/docs >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
# Handling git
cd ${ROOT_PATH} && git fetch --all && git reset --hard origin/${GIT_BRANCH} && git pull >> ${ROOT_PATH}/${BUILD_PATH}/logs/build.log
# Permission handling
chmod -R 777 ${ROOT_PATH}
# Change path for correct script inclusion
cd ${ROOT_PATH}/${BUILD_PATH}
# Setting up demo
# Setting up database for demo and testing
mysql -e 'drop database if exists oms;' -u root -p${DB_PASSWORD}
mysql -e 'create database oms;' -u root -p${DB_PASSWORD}
#echo "USE mysql;\nUPDATE user SET password=PASSWORD('123456') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
curl --connect-timeout 600 --max-time 601 ${WEB_URL}/Admin/Install
# Downloading tools
wget -nc https://phar.phpunit.de/phploc.phar
wget -nc https://phar.phpunit.de/phpunit.phar
wget -nc https://github.com/Halleck45/PhpMetrics/raw/master/build/phpmetrics.phar
wget -nc http://phpdoc.org/phpDocumentor.phar
wget -nc http://static.pdepend.org/php/latest/pdepend.phar
wget -nc https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget -nc http://static.phpmd.org/php/latest/phpmd.phar
wget -nc https://phar.phpunit.de/phpcpd.phar
wget -nc http://dl.google.com/closure-compiler/compiler-latest.tar.gz
tar -zxvf compiler-latest.tar.gz
# Installing tools
[[ $(jsonlint -h) != *"Usage: jsonlint"* ]] && npm install jsonlint -g

18
var.sh
View File

@ -10,8 +10,22 @@ WEB_URL="http://orange-management.de"
MAIL_ADDR=""
# Git variables
GITHUB_URL="https://github.com/spl1nes/Orange-Management.git"
GITHUB_URL[0]="https://github.com/Orange-Management/Orange-Management.git"
GITHUB_URL[1]="https://github.com/Orange-Management/Build.git"
GITHUB_URL[2]="https://github.com/Orange-Management/Console.git"
GITHUB_URL[3]="https://github.com/Orange-Management/cssOMS.git"
GITHUB_URL[4]="https://github.com/Orange-Management/Demo.git"
GITHUB_URL[5]="https://github.com/Orange-Management/Docs.git"
GITHUB_URL[6]="https://github.com/Orange-Management/Install.git"
GITHUB_URL[7]="https://github.com/Orange-Management/jsOMS.git"
GITHUB_URL[8]="https://github.com/Orange-Management/Model.git"
GITHUB_URL[9]="https://github.com/Orange-Management/phpOMS.git"
GITHUB_URL[10]="https://github.com/Orange-Management/Release.git"
GITHUB_URL[11]="https://github.com/Orange-Management/Resources.git"
GITHUB_URL[12]="https://github.com/Orange-Management/Socket.git"
GITHUB_URL[13]="https://github.com/Orange-Management/Tests.git"
GITHUB_URL[14]="https://github.com/Orange-Management/Web.git"
GIT_BRANCH="develop"
VERSION_HASH=$(git rev-parse HEAD)
DATE=$(date +%Y-%m-%d)