Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc63d04c6b | ||
|
|
0cbf98d43e | ||
|
|
0359e12555 | ||
|
|
83e17cec7c | ||
|
|
05e4c00b7f | ||
|
|
69eb59b93b | ||
|
|
4883c53419 | ||
|
|
a0bafc453f | ||
|
|
b515760e6d | ||
|
|
ea4e0c0ec3 | ||
|
|
3f04905d22 | ||
|
|
0ab6391bf3 | ||
|
|
a66dfa8530 | ||
|
|
09cf83c31b | ||
|
|
aac8e9786d | ||
|
|
bcfea0cfad | ||
|
|
8a097b5956 | ||
|
|
effeae054e |
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
function exit_func {
|
||||
echo "SIGTERM detected"
|
||||
exit 1
|
||||
}
|
||||
trap exit_func SIGTERM SIGINT
|
||||
|
||||
ASD_BINDIR="/home/${DDNINJA_AUTHOR}/private/${DDNINJA_BUILDNAME}/bin"
|
||||
|
||||
mkdir -p "/tmp/${DDNINJA_AUTHOR}/${DDNINJA_BUILDNAME}"
|
||||
mkdir -p "/home/${DDNINJA_AUTHOR}/storage/${DDNINJA_BUILDNAME}/media/"
|
||||
mkdir -p "/var/log/${DDNINJA_AUTHOR}/${DDNINJA_BUILDNAME}/"
|
||||
|
||||
php /home/${DDNINJA_AUTHOR}/private/${DDNINJA_BUILDNAME}/bin/worker.php & wait
|
||||
exit $?
|
||||
Executable
+83
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
use ASD\ThresholdTimer;
|
||||
|
||||
require_once(dirname(__FILE__)."/../load.php");
|
||||
|
||||
require_once("/home/ddninja/private/asdphp/lib/core/ThresholdTimer.php");
|
||||
|
||||
|
||||
$timer = new ThresholdTimer(60);
|
||||
|
||||
function logInfo(string $msg) {
|
||||
echo date("Y-m-d H:i")." - ".$msg,PHP_EOL;
|
||||
}
|
||||
function execHour() {
|
||||
return intval(date('i')) == 0;
|
||||
}
|
||||
function execDay() {
|
||||
return execHour() && intval(date('H')) == 3;
|
||||
}
|
||||
function getMinuteTasks() {
|
||||
return [
|
||||
GenerateAdminActivationMailTask::class,
|
||||
GenerateUserActivationMailTask::class,
|
||||
GenerateAdminPasswordRecoveryMailTask::class,
|
||||
GenerateUserPasswordRecoveryMailTask::class,
|
||||
MailSendTask::class
|
||||
];
|
||||
}
|
||||
function getHourTasks() {
|
||||
return [
|
||||
// NewsletterCheckTask::class,
|
||||
DeleteOldPasswordResetRequestsTask::class,
|
||||
UpdateMeteoCacheTask::class,
|
||||
GenerateCommentiWarningMailTask::class
|
||||
];
|
||||
}
|
||||
function getDailyTasks() {
|
||||
return [
|
||||
// SendBackupTask::class
|
||||
];
|
||||
}
|
||||
|
||||
function execute($taskName) {
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
logInfo("Executing task $taskName");
|
||||
$taskName::execute();
|
||||
logInfo("Task $taskName executed with success");
|
||||
}
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
logInfo("Task $taskName failed execution");
|
||||
var_dump($ex);
|
||||
}
|
||||
}
|
||||
|
||||
logInfo("Worker STARTED!!");
|
||||
|
||||
$count = 1;
|
||||
while (1) {
|
||||
logInfo("Executing Minute");
|
||||
foreach (getMinuteTasks() as $task ) {
|
||||
execute($task);
|
||||
}
|
||||
if (execHour()) {
|
||||
logInfo("Exec hourly");
|
||||
foreach (getHourTasks() as $task ) {
|
||||
execute($task);
|
||||
}
|
||||
}
|
||||
if (execDay()) {
|
||||
logInfo("Exec Daily");
|
||||
foreach (getDailyTasks() as $task ) {
|
||||
execute($task);
|
||||
}
|
||||
}
|
||||
|
||||
$timer->waitUntilThresholdReached(true);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -36,7 +36,7 @@ $currentSystem->apache->user = "var-www";
|
||||
$currentSystem->apache->group = "var-www";
|
||||
$currentSystem->apache->workdir = "/var/www"; // Il path in cui inserire la cartella con le pagine html
|
||||
|
||||
$currentSystem->remoteLocationPath = getenv('ASD_PUBLIC_URL')."/";
|
||||
$currentSystem->remoteLocationPath = getenv('DDNINJA_PUBLIC_URL')."/";
|
||||
|
||||
// Deprecato in quanto CBS2 è stato dismesso
|
||||
$backupSystem = new stdClass();
|
||||
@@ -132,4 +132,11 @@ $config->cbs2->serverPort = $cbs2->serverPort;
|
||||
|
||||
$config->database = $database;
|
||||
|
||||
$config->mailer = new stdClass();
|
||||
$config->mailer->address = "email-smtp.eu-west-1.amazonaws.com";
|
||||
$config->mailer->port = "587";
|
||||
$config->mailer->username = "AKIASMB7IW2MQPUP5CXS";
|
||||
$config->mailer->password = "BHv+82Nns1kIKg99Hx0sjKlEpR+X4+1EgX+ec64n/mBt";
|
||||
$config->mailer->smtpAuth = true;
|
||||
|
||||
?>
|
||||
|
||||
@@ -61,7 +61,7 @@ class BannerHelper {
|
||||
|
||||
|
||||
private static function getBannerImpressions($bannerIds) {
|
||||
$time = strtotime("today CET");
|
||||
$time = strtotime("today");
|
||||
$stats = GlobalVariables::get("dao")->query(
|
||||
BannerStatsModel::class,
|
||||
[
|
||||
|
||||
@@ -193,7 +193,7 @@ class PipelineHelper {
|
||||
'statType'=>StatisticModel::STAT_TYPE_BANNER_IMPRESSION,
|
||||
'content.position'=>$position,
|
||||
// 'date'=>array( '$gte'=>new MongoDate(strtotime("today")) )
|
||||
'date'=>array( '$gte'=>new MongoDB\BSON\UTCDateTime(strtotime("today CET") * 1000) )
|
||||
'date'=>array( '$gte'=>new MongoDB\BSON\UTCDateTime(strtotime("today") * 1000) )
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
||||
@@ -42,36 +42,46 @@ class MailModel extends Model implements FDN_MailInterface{
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public function getMailObject(){
|
||||
$email = new PHPMailer();
|
||||
$email->CharSet = "UTF-8";
|
||||
$email->isMail();
|
||||
|
||||
public function getMailObject() {
|
||||
$email = new PHPMailer();
|
||||
$email->CharSet = "UTF-8";
|
||||
$email->isMail();
|
||||
|
||||
$email->From = $this->from;
|
||||
$email->FromName = "I Fatti di Napoli";
|
||||
|
||||
$email->From = $this->from;
|
||||
if ($this->hasProperty("fromName")){
|
||||
$email->FromName = $this->fromName;
|
||||
}
|
||||
|
||||
$email->Subject = $this->subject;
|
||||
$email->Subject = $this->subject;
|
||||
|
||||
$email->IsHTML(true);
|
||||
|
||||
$email->Body = $this->body;
|
||||
|
||||
|
||||
$email->Body = $this->body;
|
||||
if ($this->hasProperty("altBody")){
|
||||
$email->AltBody = $this->altBody;
|
||||
}
|
||||
else {
|
||||
$email->AltBody = strip_tags($this->body);
|
||||
}
|
||||
|
||||
$email->AddAddress($this->recipient);
|
||||
|
||||
|
||||
$email->AddAddress($this->recipient);
|
||||
|
||||
if ($this->hasProperty("attachment")){
|
||||
$email->AddAttachment( $this->attachment , basename($this->attachment) );
|
||||
}
|
||||
|
||||
return $email;
|
||||
}
|
||||
|
||||
$cfg = GlobalVariables::get("config");
|
||||
|
||||
$email->IsSMTP();
|
||||
$email->Host = $cfg->mailer->address;
|
||||
$email->Port = $cfg->mailer->port;
|
||||
$email->Username = $cfg->mailer->username;
|
||||
$email->Password = $cfg->mailer->password;
|
||||
$email->SMTPAuth = $cfg->mailer->smtpAuth;
|
||||
|
||||
return $email;
|
||||
}
|
||||
|
||||
public static function getCollectionName(){
|
||||
return "mail";
|
||||
|
||||
@@ -28,7 +28,7 @@ class ArticleStatsModel extends Model {
|
||||
}
|
||||
|
||||
public static function getFilter($articleId, $day, $month, $year) {
|
||||
$time = strtotime("$year-$month-$day CET");
|
||||
$time = strtotime("$year-$month-$day");
|
||||
return [
|
||||
'notizia' => $articleId,
|
||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||
|
||||
@@ -16,7 +16,7 @@ class BannerStatsModel extends Model {
|
||||
}
|
||||
|
||||
public static function new($bannerId, $day, $month, $year) {
|
||||
$time = strtotime("$year-$month-$day CET");
|
||||
$time = strtotime("$year-$month-$day");
|
||||
return new static(
|
||||
(object)[
|
||||
'banner' => $bannerId,
|
||||
@@ -30,7 +30,7 @@ class BannerStatsModel extends Model {
|
||||
);
|
||||
}
|
||||
public static function getFilter($bannerId, $day, $month, $year) {
|
||||
$time = strtotime("$year-$month-$day CET");
|
||||
$time = strtotime("$year-$month-$day");
|
||||
return [
|
||||
'banner' => $bannerId,
|
||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||
|
||||
@@ -15,7 +15,7 @@ class PageViewStatsModel extends Model {
|
||||
return "pageview_stats";
|
||||
}
|
||||
public static function new($page, $day, $month, $year) {
|
||||
$time = strtotime("$year-$month-$day CET");
|
||||
$time = strtotime("$year-$month-$day");
|
||||
|
||||
return new static(
|
||||
(object)[
|
||||
@@ -33,7 +33,7 @@ class PageViewStatsModel extends Model {
|
||||
}
|
||||
|
||||
public static function getFilter($page, $day, $month, $year) {
|
||||
$time = strtotime("$year-$month-$day CET");
|
||||
$time = strtotime("$year-$month-$day");
|
||||
return [
|
||||
'page' => $page,
|
||||
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
||||
|
||||
@@ -215,7 +215,7 @@ class GUIHandler {
|
||||
<div class="leftBanner topBanner mediaContent">
|
||||
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
||||
</div>
|
||||
<div class="logo"><a href="http://ifattidinapoli.it/index.php"><img src="http://ifattidinapoli.it/images/logo_uff.png"></a></div>
|
||||
<div class="logo"><a href="http://www.ifattidinapoli.it/index.php"><img src="http://www.ifattidinapoli.it/images/logo_uff.png"></a></div>
|
||||
<div class="rightBanner topBanner mediaContent">
|
||||
<?php BannerHelper::printBanner(BannerModel::POSITION_HEAD);?>
|
||||
</div>
|
||||
@@ -381,7 +381,7 @@ class GUIHandler {
|
||||
|
||||
$stats = GlobalVariables::get("dao")->aggregate(
|
||||
ArticleStatsModel::class,
|
||||
PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days CET"),5)
|
||||
PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days"),5)
|
||||
);
|
||||
$idArray = array_map(function ($ele){ return new MongoDB\BSON\ObjectID($ele["notizia"]);}, $stats);
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ class MenuGenerator {
|
||||
|
||||
array("label"=>"Utenti registrati","page"=>"listUsers.php","requires"=>AdminModel::ADMIN_TYPE_NORMALADMIN),
|
||||
array("label"=>"Newsletter", "subvoices"=>array(
|
||||
array("label"=>"Nuova","page"=>"editNewsletter.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
array("label"=>"Da inviare","page"=>"pendingNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
array("label"=>"Inviate","page"=>"sentNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
// array("label"=>"Nuova","page"=>"editNewsletter.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
// array("label"=>"Da inviare","page"=>"pendingNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
// array("label"=>"Inviate","page"=>"sentNewsletters.php","requires"=>AdminModel::ADMIN_TYPE_NEWSLETTER),
|
||||
array("label"=>"Nuova Mail","page"=>"editMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN),
|
||||
array("label"=>"Coda Mail","page"=>"listMail.php","requires"=>AdminModel::ADMIN_TYPE_SUPERADMIN)
|
||||
)),
|
||||
|
||||
@@ -4,6 +4,8 @@ Author: Riccardo Di Dato
|
||||
Creation Date: 04/feb/2013
|
||||
*/
|
||||
|
||||
date_default_timezone_set("Europe/Rome");
|
||||
|
||||
require_once(dirname(__FILE__)."/common/config.php");
|
||||
|
||||
require_once(dirname(__FILE__)."/lib/lib.inclusions.php");
|
||||
|
||||
@@ -72,13 +72,13 @@ try{
|
||||
<div class="bannerStat">
|
||||
<div>
|
||||
<div class="statName">Oggi</div>
|
||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("today CET"));?></div>
|
||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("today CET"));?></div>
|
||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("today"));?></div>
|
||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("today"));?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="statName">Ultima settimana</div>
|
||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("-7 days CET"));?></div>
|
||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("-7 days CET"));?></div>
|
||||
<div>Visualizzazioni: <?php echo AnalyticsHelper::countBannerImpressions($banner->id,strtotime("-7 days"));?></div>
|
||||
<div class="toHide">Click: <?php echo AnalyticsHelper::countBannerClicks($banner->id,strtotime("-7 days"));?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="statName">Totali</div>
|
||||
|
||||
@@ -144,11 +144,11 @@ try{
|
||||
<div class="notiziaStat">
|
||||
<div>
|
||||
<div class="statName">Oggi</div>
|
||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("today CET"));?></div>
|
||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("today"));?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="statName">Ultima settimana</div>
|
||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("-7 days CET"));?></div>
|
||||
<div><?php echo AnalyticsHelper::countNotiziaImpressions($notizia->id,strtotime("-7 days"));?></div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="statName">Totali</div>
|
||||
|
||||
@@ -74,7 +74,7 @@ HTMLHelper::generateAdminHead();
|
||||
<li>Banner testata:<b>180x60px</b></li>
|
||||
<li>Banner corpo:<b>160x120px</b></li>
|
||||
<li>Banner lungo:<b>160x240px</b></li>
|
||||
<li>Banner Inizio pagina:<b>1000x120px</b></li>
|
||||
<li>Banner Inizio pagina:<b>1000x150px</b></li>
|
||||
<li>Banner Fine pagina:<b>1000x200px</b></li>
|
||||
</ul>
|
||||
Tale restizione è consigliata anche per i banner di tipo <i>HTML5</i>.
|
||||
|
||||
+24
-2
@@ -1,5 +1,5 @@
|
||||
const MAX_EXECUTIONS = 12;
|
||||
const ROTATION_INTERVAL = 30000;
|
||||
const ROTATION_INTERVAL = 12000;
|
||||
|
||||
const executions = {};
|
||||
|
||||
@@ -41,7 +41,29 @@ function bannerGroup(group, grpName) {
|
||||
(target) => {
|
||||
if (rval.length > 0) {
|
||||
const ele = rval.shift();
|
||||
$('#'+target).html(ele.media);
|
||||
let mediaHtml = ele.media;
|
||||
if (ele.link) {
|
||||
const a = document.createElement('a');
|
||||
a.href = ele.link;
|
||||
a.target = "_blank";
|
||||
a.innerHTML = ele.media;
|
||||
mediaHtml = a;
|
||||
}
|
||||
mediaHtml.addEventListener(
|
||||
'click',
|
||||
() => {
|
||||
$.ajax({
|
||||
url: "stats/bannerClick.php",
|
||||
method: "POST",
|
||||
data: {
|
||||
banner: ele.id,
|
||||
source: document.URL
|
||||
},
|
||||
dataType: "html"
|
||||
});
|
||||
}
|
||||
);
|
||||
$('#'+target).html(mediaHtml);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ try {
|
||||
|
||||
if (!is_null($ip) && !is_null($banners) && !is_null($source)){
|
||||
$banners = explode(",", $banners);
|
||||
$ts = strtotime('today CET');
|
||||
$ts = strtotime('today');
|
||||
|
||||
foreach ($banners as $banner) {
|
||||
AnalyticsHelper::bannerImpression(
|
||||
|
||||
@@ -28,7 +28,7 @@ body{font-family:lato, arial;}
|
||||
.rightBanner{position:absolute;top:45px;right:10px;}
|
||||
.topBanner{width:180px;height:60px;}
|
||||
.topBanner > * { max-width:100%; max-height:100%; }
|
||||
.subheadBanner { width:1000px; height:120px; }
|
||||
.subheadBanner { width:1000px; height:150px; }
|
||||
.footerBanner { width:1000px; height:200px; }
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
FROM alpine:3.6
|
||||
|
||||
RUN apk add --no-cache --upgrade bash mongodb-tools
|
||||
|
||||
# copy crontabs for root user
|
||||
COPY crontab /etc/crontabs/root
|
||||
|
||||
# copy backup script
|
||||
COPY backup /myscripts/backup
|
||||
RUN chmod 0744 /myscripts/backup
|
||||
|
||||
# start crond with log level 8 in foreground, output to stderr
|
||||
CMD ["crond", "-f", "-d", "8"]
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
DATE=`date +"%Y-%m-%d_%H:%M"`
|
||||
|
||||
echo "Generating backup $DATE"
|
||||
|
||||
DATABASE_HOST="fdn2.production.database"
|
||||
DATABASE_NAME="fdn2"
|
||||
DATABASE_PORT="27017"
|
||||
WORKDIR="/workdir"
|
||||
STORAGE="/backups"
|
||||
|
||||
mkdir -p $WORKDIR
|
||||
|
||||
mongodump --host $DATABASE_HOST -d $DATABASE_NAME --port $DATABASE_PORT --out "$WORKDIR"
|
||||
|
||||
tar -cvzf "$STORAGE/dump-$DATE.tar.gz" "$WORKDIR"
|
||||
|
||||
for old in `ls -t $STORAGE | tail -n +7`; do
|
||||
TOREMOVE="$STORAGE/$old"
|
||||
echo "Removing '$TOREMOVE'";
|
||||
rm -r $TOREMOVE
|
||||
done
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
4 0 * * * /myscripts/backup 2>&1
|
||||
@@ -0,0 +1,17 @@
|
||||
version: "3"
|
||||
services:
|
||||
backup:
|
||||
image: cronjob
|
||||
build: ./
|
||||
networks:
|
||||
- backup-network
|
||||
restart: "unless-stopped"
|
||||
volumes:
|
||||
- /home/ddninja/fdn2/backups:/backups
|
||||
|
||||
|
||||
networks:
|
||||
backup-network:
|
||||
external: true
|
||||
name:
|
||||
backup-network
|
||||
@@ -5,8 +5,11 @@ services:
|
||||
restart: "on-failure:5"
|
||||
networks:
|
||||
db-network:
|
||||
backup-network:
|
||||
aliases:
|
||||
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database
|
||||
volumes:
|
||||
- ./persistence/database/mongodb:/usr/local/mongodb
|
||||
- ./persistence/database/mongodb:/data/db/
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
@@ -30,7 +33,7 @@ services:
|
||||
links:
|
||||
- mongo:database
|
||||
volumes:
|
||||
- ./persistence/webserver/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- §PROJECT_BUILDNAME§-ws-log:/var/log/§PROJECT_AUTHOR§/
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
logging:
|
||||
@@ -38,23 +41,32 @@ services:
|
||||
options:
|
||||
max-file: "5"
|
||||
max-size: "150m"
|
||||
# worker:
|
||||
# image: 662348923997.dkr.ecr.eu-west-1.amazonaws.com/§PROJECT_GROUP§/edenlandia-worker:§TAG_NAME§
|
||||
# env_file: worker.env
|
||||
# restart: "no"
|
||||
# networks:
|
||||
# db-network:
|
||||
# §PROJECT_BUILDNAME§-network:
|
||||
# links:
|
||||
# - mongo:database
|
||||
# volumes:
|
||||
# - §PROJECT_BUILDNAME§-storage:/home/asdynamics/storage/edenlandia-worker
|
||||
# - edenlandia-worker-log:/var/log/asdynamics/
|
||||
# - ~/workspace-azzurro/webapps/edenlandia-worker/app/private:/home/asdynamics/private/§PROJECT_BUILDNAME§:ro
|
||||
# - §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
worker:
|
||||
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-worker
|
||||
env_file:
|
||||
- environments/common/worker.env
|
||||
- environments/§ENVIRONMENT_TYPE§/worker.env
|
||||
depends_on:
|
||||
- mongo
|
||||
- memcached
|
||||
restart: "on-failure:3"
|
||||
networks:
|
||||
db-network:
|
||||
§PROJECT_BUILDNAME§-network:
|
||||
links:
|
||||
- mongo:database
|
||||
volumes:
|
||||
- ./persistence/storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- §PROJECT_BUILDNAME§-wk-log:/var/log/§PROJECT_AUTHOR§/
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-file: "5"
|
||||
max-size: "150m"
|
||||
memcached:
|
||||
image: memcached:1.6.9-alpine
|
||||
restart: "on-failure:3"
|
||||
restart: "on-failure:5"
|
||||
networks:
|
||||
§PROJECT_BUILDNAME§-network:
|
||||
logging:
|
||||
@@ -66,6 +78,10 @@ services:
|
||||
networks:
|
||||
db-network:
|
||||
§PROJECT_BUILDNAME§-network:
|
||||
backup-network:
|
||||
external: true
|
||||
name:
|
||||
backup-network
|
||||
nginx-network:
|
||||
external: true
|
||||
name:
|
||||
@@ -74,5 +90,7 @@ networks:
|
||||
|
||||
volumes:
|
||||
§PROJECT_BUILDNAME§-ws-log:
|
||||
§PROJECT_BUILDNAME§-wk-log:
|
||||
§PROJECT_BUILDNAME§-db-persist:
|
||||
§PROJECT_BUILDNAME§-job-comms:
|
||||
§PROJECT_BUILDNAME§-job-comms:
|
||||
|
||||
@@ -5,12 +5,13 @@ services:
|
||||
restart: "no"
|
||||
networks:
|
||||
db-network:
|
||||
backup-network:
|
||||
aliases:
|
||||
- §PROJECT_BUILDNAME§.§ENVIRONMENT_TYPE§.database
|
||||
- §PROJECT_BUILDNAME§.local.database
|
||||
volumes:
|
||||
- §PROJECT_BUILDNAME§-db-persist:/usr/local/mongodb
|
||||
- §PROJECT_BUILDNAME§-db-persist:/data/db/
|
||||
webserver:
|
||||
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-debug
|
||||
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-webserver-debug
|
||||
env_file:
|
||||
- environments/common/webserver.env
|
||||
- environments/local/webserver.env
|
||||
@@ -28,20 +29,22 @@ services:
|
||||
- §DEBUG_HOST_PROJECT_FOLDER§/app/public:/var/www/§PROJECT_BUILDNAME§:ro
|
||||
- §DEBUG_HOST_PROJECT_FOLDER§/app/private:/home/§PROJECT_AUTHOR§/private/§PROJECT_BUILDNAME§:ro
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
# worker:
|
||||
# image: 662348923997.dkr.ecr.eu-west-1.amazonaws.com/§PROJECT_GROUP§/edenlandia-worker:§TAG_NAME§
|
||||
# env_file: worker.env
|
||||
# restart: "no"
|
||||
# networks:
|
||||
# db-network:
|
||||
# §PROJECT_BUILDNAME§-network:
|
||||
# links:
|
||||
# - mongo:database
|
||||
# volumes:
|
||||
# - §PROJECT_BUILDNAME§-storage:/home/asdynamics/storage/edenlandia-worker
|
||||
# - edenlandia-worker-log:/var/log/asdynamics/
|
||||
# - ~/workspace-azzurro/webapps/edenlandia-worker/app/private:/home/asdynamics/private/§PROJECT_BUILDNAME§:ro
|
||||
# - §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
worker:
|
||||
image: §PROJECT_REPOSITORY§/§PROJECT_GROUP§/§PROJECT_BUILDNAME§:§TAG_NAME§-worker-debug
|
||||
env_file:
|
||||
- environments/common/worker.env
|
||||
- environments/local/worker.env
|
||||
restart: "no"
|
||||
networks:
|
||||
db-network:
|
||||
§PROJECT_BUILDNAME§-network:
|
||||
links:
|
||||
- mongo:database
|
||||
volumes:
|
||||
- §PROJECT_BUILDNAME§-storage:/home/§PROJECT_AUTHOR§/storage/§PROJECT_BUILDNAME§
|
||||
- ./worker-logs:/var/log/§PROJECT_AUTHOR§/
|
||||
- §DEBUG_HOST_PROJECT_FOLDER§/app/private:/home/§PROJECT_AUTHOR§/private/§PROJECT_BUILDNAME§:ro
|
||||
- §PROJECT_BUILDNAME§-job-comms:/jobComunication/
|
||||
memcached:
|
||||
image: memcached:1.6.9-alpine
|
||||
restart: "no"
|
||||
@@ -51,11 +54,14 @@ services:
|
||||
networks:
|
||||
db-network:
|
||||
§PROJECT_BUILDNAME§-network:
|
||||
backup-network:
|
||||
external: true
|
||||
name:
|
||||
backup-network
|
||||
|
||||
|
||||
volumes:
|
||||
§PROJECT_BUILDNAME§-storage:
|
||||
§PROJECT_BUILDNAME§-log:
|
||||
# edenlandia-worker-log:
|
||||
§PROJECT_BUILDNAME§-db-persist:
|
||||
§PROJECT_BUILDNAME§-job-comms:
|
||||
@@ -1,5 +1,5 @@
|
||||
# Use a PHP runtime as a parent image
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||
|
||||
|
||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Use a PHP runtime as a parent image
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||
|
||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§-unit
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-webserver-unit
|
||||
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
COPY ./app /§PROJECT_BUILDNAME§
|
||||
@@ -9,7 +9,7 @@ COPY ./test/install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install webserver
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
||||
CMD ["--help"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Use a PHP runtime as a parent image
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install worker
|
||||
|
||||
|
||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Use a PHP runtime as a parent image
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
@@ -27,7 +27,7 @@ COPY ./install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install worker
|
||||
|
||||
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§-unit
|
||||
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-worker-unit
|
||||
|
||||
WORKDIR /§PROJECT_BUILDNAME§
|
||||
COPY ./app /§PROJECT_BUILDNAME§
|
||||
@@ -9,7 +9,7 @@ COPY ./test/install /§PROJECT_BUILDNAME§
|
||||
|
||||
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||
|
||||
RUN /§PROJECT_BUILDNAME§/install
|
||||
RUN /§PROJECT_BUILDNAME§/install worker
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
||||
CMD ["--help"]
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
DDNINJA_PROJECTNAME=FDN2
|
||||
DDNINJA_BUILDNAME=fdn2
|
||||
DDNINJA_AUTHOR=ddninja
|
||||
@@ -0,0 +1,7 @@
|
||||
DDNINJA_ENVIRONMENT_NAME=local
|
||||
DDNINJA_IS_PRODUCTION=false
|
||||
|
||||
DDNINJA_MONGO_DBNAME=fdn2
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://www.fdn2.loc:8800
|
||||
@@ -4,4 +4,4 @@ DDNINJA_IS_PRODUCTION=true
|
||||
DDNINJA_MONGO_DBNAME=fdn2
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://preproduction.ifattidinapoli.it
|
||||
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
DDNINJA_ENVIRONMENT_NAME=production
|
||||
DDNINJA_IS_PRODUCTION=true
|
||||
|
||||
DDNINJA_MONGO_DBNAME=fdn2
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://www.ifattidinapoli.it
|
||||
@@ -0,0 +1,7 @@
|
||||
DDNINJA_ENVIRONMENT_NAME=test
|
||||
DDNINJA_IS_PRODUCTION=false
|
||||
|
||||
DDNINJA_MONGO_DBNAME=fdn2_test
|
||||
DDNINJA_MONGO_LOCATION=database
|
||||
|
||||
DDNINJA_PUBLIC_URL=http://test.ifattidinapoli.it
|
||||
@@ -4,7 +4,6 @@ declare -A CONFIG=(
|
||||
["FRAMEWORK_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
||||
["FRAMEWORK_IMAGE"]="ddninja/phpframework"
|
||||
["FRAMEWORK_VERSION"]="2.5.4"
|
||||
["FRAMEWORK_TYPE"]="webserver"
|
||||
["FRAMEWORK_AUTHOR"]="ddninja"
|
||||
|
||||
["PROJECT_REPOSITORY"]="299952237278.dkr.ecr.eu-west-1.amazonaws.com"
|
||||
@@ -23,7 +22,6 @@ declare -A CONFIG=(
|
||||
FRAMEWORK_REPOSITORY=${CONFIG['FRAMEWORK_REPOSITORY']}
|
||||
FRAMEWORK_IMAGE=${CONFIG['FRAMEWORK_IMAGE']}
|
||||
FRAMEWORK_VERSION=${CONFIG['FRAMEWORK_VERSION']}
|
||||
FRAMEWORK_TYPE=${CONFIG['FRAMEWORK_TYPE']}
|
||||
FRAMEWORK_AUTHOR=${CONFIG['FRAMEWORK_AUTHOR']}
|
||||
|
||||
PROJECT_REPOSITORY=${CONFIG['PROJECT_REPOSITORY']}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Illegal number of parameters"
|
||||
fi
|
||||
|
||||
TYPE=$1
|
||||
|
||||
my_dir="$(dirname "$0")"
|
||||
DIR_RETURN=`pwd`
|
||||
|
||||
@@ -25,11 +31,13 @@ chown -R www-data:www-data /var/log/$PROJECT_AUTHOR
|
||||
chmod 0744 /home/$PROJECT_AUTHOR/private/$PROJECT_BUILDNAME/bin/*
|
||||
|
||||
# Apache
|
||||
cat ./os/000-${PROJECT_TYPE}.template.conf |
|
||||
sed -e "s/§PROJECT_BUILDNAME§/${PROJECT_BUILDNAME}/g" \
|
||||
> /etc/apache2/sites-available/000-default.conf
|
||||
if [[ $TYPE == "webserver" ]]; then
|
||||
cat ./os/000-${PROJECT_TYPE}.template.conf |
|
||||
sed -e "s/§PROJECT_BUILDNAME§/${PROJECT_BUILDNAME}/g" \
|
||||
> /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
a2enmod rewrite
|
||||
a2enmod rewrite
|
||||
fi
|
||||
|
||||
# Overwrite opcache default config
|
||||
cat ./os/opcache.template.ini |
|
||||
@@ -40,7 +48,7 @@ cat ./os/opcache.template.ini |
|
||||
cat ./os/php.template.ini > /usr/local/etc/php/php.ini
|
||||
|
||||
# Generate Entrypoint
|
||||
cp "./os/webserver-entrypoint" "/usr/local/bin/$PROJECT_BUILDNAME-entrypoint"
|
||||
cp "./os/${TYPE}-entrypoint" "/usr/local/bin/$PROJECT_BUILDNAME-entrypoint"
|
||||
chmod 0744 /usr/local/bin/$PROJECT_BUILDNAME-entrypoint
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
// try {
|
||||
|
||||
// }
|
||||
// catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
|
||||
|
||||
?>
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array("SendBackupTask");
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try {
|
||||
|
||||
|
||||
// }catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
|
||||
?>
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array("NewsletterCheckTask","DeleteOldPasswordResetRequestsTask", "UpdateMeteoCacheTask", "GenerateCommentiWarningMailTask");
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try {
|
||||
// SystemController::executeTask("RefreshApiCache.php");
|
||||
// }
|
||||
// catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
||||
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("GenerateReminderMail.php",$msg),true);
|
||||
|
||||
// }
|
||||
|
||||
?>
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/*
|
||||
Author: Riccardo Di Dato
|
||||
Creation Date: 12/gen/2016
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
$tasks = array(
|
||||
"GenerateAdminActivationMailTask",
|
||||
"GenerateUserActivationMailTask",
|
||||
"GenerateAdminPasswordRecoveryMailTask",
|
||||
"GenerateUserPasswordRecoveryMailTask",
|
||||
"MailSendTask",
|
||||
);
|
||||
|
||||
if (sizeof($tasks)>0){
|
||||
foreach ($tasks as $taskName){
|
||||
try {
|
||||
if ($taskName::isActive()){
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Executing task '".$taskName::getLabel()."' ");
|
||||
$taskName::execute();
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_INFO,"Task '".$taskName::getLabel()."' completed successfully");
|
||||
}
|
||||
}catch (CoreException $ex){
|
||||
$msg = "Error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
catch (Exception $ex){
|
||||
$msg = "Unexpected error while executing task '".$taskName::getLabel()."' with message '".$ex->getMessage()."'";
|
||||
LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,$msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
require_once(dirname(__FILE__). "/../load.php");
|
||||
|
||||
// try {
|
||||
|
||||
// }catch (UNHADBException $unex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($unex->getMessage(),$unex->getData());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
// catch (Exception $ex){
|
||||
// $msg = $application->core->loggingCatalogManager->getCatalog($ex->getMessage());
|
||||
// LoggingFacilityManager::getLogger("task")->log(LoggingFacility::$LEVEL_ERROR,"log.task.errorWhileExecutingTask",array("ProcessMailQueue.php",$msg),true);
|
||||
// }
|
||||
|
||||
?>
|
||||
+2
-2
@@ -97,7 +97,7 @@ if [[ $UNIT_MODE -gt 0 ]]; then
|
||||
OPTS+="v"
|
||||
fi
|
||||
|
||||
$DIR/generateDockerfile.sh -$OPTS -o $DOCKERFILE
|
||||
$DIR/generateDockerfile.sh -I "${TYPE}" -$OPTS -o $DOCKERFILE
|
||||
|
||||
msg "Building project image $TAG"
|
||||
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-unit -f $DOCKERFILE .
|
||||
@@ -112,7 +112,7 @@ if [[ $DEBUG_MODE -gt 0 ]]; then
|
||||
OPTS+="v"
|
||||
fi
|
||||
|
||||
$DIR/generateDockerfile.sh -$OPTS -o $DOCKERFILE
|
||||
$DIR/generateDockerfile.sh -I "${TYPE}" -$OPTS -o $DOCKERFILE
|
||||
|
||||
msg "Building project image $TAG"
|
||||
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG-debug -f $DOCKERFILE .
|
||||
|
||||
+18
-6
@@ -125,10 +125,14 @@ if [[ $UNIT_MODE -eq 1 ]]; then
|
||||
BUILDOPT+="v"
|
||||
UNITOPT="-v"
|
||||
fi
|
||||
msg "running ./build.sh -$BUILDOPT -t $TAG"
|
||||
./build.sh -$BUILDOPT -t $TAG
|
||||
msg "running ./build.sh -I webserver -$BUILDOPT -t \"$TAG-webserver\""
|
||||
./build.sh -I webserver -$BUILDOPT -t "$TAG-webserver"
|
||||
|
||||
./run-unit.sh $UNITOPT -t $TAG
|
||||
msg "running ./build.sh -I worker -$BUILDOPT -t \"$TAG-worker\""
|
||||
./build.sh -I worker -$BUILDOPT -t "$TAG-worker"
|
||||
|
||||
./run-unit.sh $UNITOPT -t $TAG-webserver
|
||||
./run-unit.sh $UNITOPT -t $TAG-worker
|
||||
fi
|
||||
|
||||
if [[ $PUBLISH_MODE -eq 1 ]]; then
|
||||
@@ -151,7 +155,13 @@ if [[ $PUBLISH_MODE -eq 1 ]]; then
|
||||
|
||||
./publish.sh $VERBOPT -t "$TAG-webserver"
|
||||
|
||||
|
||||
# WORKER
|
||||
msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker"
|
||||
./build.sh -I worker -$BUILDOPT -t "$TAG-worker"
|
||||
|
||||
./run-unit.sh $VERBOPT -t "$TAG-worker"
|
||||
|
||||
./publish.sh $VERBOPT -t "$TAG-worker"
|
||||
|
||||
if [[ $TAG_IMPLICIT -ne 1 ]]; then
|
||||
git tag $TAG
|
||||
@@ -165,8 +175,10 @@ if [[ $DEBUG_MODE -eq 1 ]]; then
|
||||
if [[ $VERBOSE -gt 0 ]]; then
|
||||
BUILDOPT+="v"
|
||||
fi
|
||||
msg "running ./build.sh -$BUILDOPT -t $TAG"
|
||||
./build.sh -$BUILDOPT -t $TAG
|
||||
msg "running ./build.sh -I webserver -$BUILDOPT -t $TAG-webserver"
|
||||
./build.sh -$BUILDOPT -I webserver -t $TAG-webserver
|
||||
msg "running ./build.sh -I worker -$BUILDOPT -t $TAG-worker"
|
||||
./build.sh -$BUILDOPT -I worker -t $TAG-worker
|
||||
|
||||
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/local"
|
||||
mkdir -p $OUT_FOLDER
|
||||
|
||||
Reference in New Issue
Block a user