Compare commits
5
Commits
2.0.3-rc.0
...
2.0.3-rc.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
617a3f50eb | ||
|
|
c666b50dd8 | ||
|
|
34fb57fa81 | ||
|
|
7680378f28 | ||
|
|
7bab6253cf |
@@ -19,12 +19,6 @@
|
|||||||
RewriteRule "Giornale/all/.*" "oldArticleRedirect.php" [L,QSA]
|
RewriteRule "Giornale/all/.*" "oldArticleRedirect.php" [L,QSA]
|
||||||
|
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<IfModule xsendfile_module>
|
|
||||||
XSendFile on
|
|
||||||
XSendFilePath "/tmp/xsend"
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
|
|||||||
@@ -13,13 +13,18 @@ class BannerModel extends HasMediaModel{
|
|||||||
const POSITION_HEAD = 1;
|
const POSITION_HEAD = 1;
|
||||||
const POSITION_BODY = 2;
|
const POSITION_BODY = 2;
|
||||||
const POSITION_LONG = 3;
|
const POSITION_LONG = 3;
|
||||||
|
|
||||||
|
const POSITION_TOP = 4;
|
||||||
|
const POSITION_BOTTOM = 5;
|
||||||
|
|
||||||
const GENERAL_CATEGORY = 0;
|
const GENERAL_CATEGORY = 0;
|
||||||
|
|
||||||
public static $BANNER_POSITIONS = array(
|
public static $BANNER_POSITIONS = array(
|
||||||
self::POSITION_HEAD=>array("label"=>"Testata"),
|
self::POSITION_HEAD=>array("label"=>"Testata"),
|
||||||
self::POSITION_BODY=>array("label"=>"Corpo"),
|
self::POSITION_BODY=>array("label"=>"Corpo"),
|
||||||
self::POSITION_LONG=>array("label"=>"Corpo Lungo")
|
self::POSITION_LONG=>array("label"=>"Corpo Lungo"),
|
||||||
|
self::POSITION_TOP=>array("label"=>"Inizio pagina"),
|
||||||
|
self::POSITION_BOTTOM=>array("label"=>"Fine pagina")
|
||||||
);
|
);
|
||||||
|
|
||||||
public function __construct($saveableObject = null){
|
public function __construct($saveableObject = null){
|
||||||
|
|||||||
@@ -196,6 +196,8 @@ try{
|
|||||||
<option value="<?php echo BannerModel::POSITION_HEAD;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_HEAD]["label"];?></option>
|
<option value="<?php echo BannerModel::POSITION_HEAD;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_HEAD]["label"];?></option>
|
||||||
<option value="<?php echo BannerModel::POSITION_BODY;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_BODY]["label"];?></option>
|
<option value="<?php echo BannerModel::POSITION_BODY;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_BODY]["label"];?></option>
|
||||||
<option value="<?php echo BannerModel::POSITION_LONG;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_LONG]["label"];?></option>
|
<option value="<?php echo BannerModel::POSITION_LONG;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_LONG]["label"];?></option>
|
||||||
|
<option value="<?php echo BannerModel::POSITION_TOP;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_TOP]["label"];?></option>
|
||||||
|
<option value="<?php echo BannerModel::POSITION_BOTTOM;?>"><?php echo BannerModel::$BANNER_POSITIONS[BannerModel::POSITION_BOTTOM]["label"];?></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -12,17 +12,11 @@ if (array_key_exists("id",$_GET)) {
|
|||||||
if (!is_null($pdfModel)){
|
if (!is_null($pdfModel)){
|
||||||
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension;
|
$localFilePath = GlobalVariables::get("config")->paths->media."/".$id.".".$pdfModel->extension;
|
||||||
if (SFSManager::fileExists($localFilePath)){
|
if (SFSManager::fileExists($localFilePath)){
|
||||||
$exposedFilePath = GlobalVariables::get("config")->paths->xsendfile."/".$id.".".$pdfModel->extension;
|
|
||||||
if (!SFSManager::fileExists($exposedFilePath)){
|
|
||||||
if (!SFSManager::fileExists(GlobalVariables::get("config")->paths->xsendfile) || !is_dir(GlobalVariables::get("config")->paths->xsendfile)){
|
|
||||||
SystemController::mkdir(GlobalVariables::get("config")->paths->xsendfile);
|
|
||||||
}
|
|
||||||
SystemController::shellExec("ln",'-nFs "'.$localFilePath.'" "'.$exposedFilePath.'"');
|
|
||||||
}
|
|
||||||
header('X-Sendfile: '.$exposedFilePath.'');
|
|
||||||
|
|
||||||
header("Content-type: application/octet-stream");
|
header("Content-type: application/octet-stream");
|
||||||
header('Content-Disposition: attachment; filename="' . basename($exposedFilePath) . '"');
|
header('Content-Disposition: attachment; filename="' . $id.".".$pdfModel->extension . '"');
|
||||||
|
|
||||||
|
echo file_get_contents($localFilePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# Use a PHP runtime as a parent image
|
||||||
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||||
|
|
||||||
|
# Set the working directory to /app
|
||||||
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
# Install GD (required by mpdf)
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -yq --no-install-recommends libpng-dev zlib1g-dev && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN docker-php-ext-install gd
|
||||||
|
|
||||||
|
# Install Memcached
|
||||||
|
RUN apt-get update && apt-get install -y libmemcached-dev \
|
||||||
|
&& pecl install memcached-3.1.5 \
|
||||||
|
&& docker-php-ext-enable memcached
|
||||||
|
|
||||||
|
# Copy the current directory contents into the container at /app
|
||||||
|
COPY ./app /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./version /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./config /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./install /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
RUN /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|
||||||
|
# Make port 80 available to the world outside this container
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Use a PHP runtime as a parent image
|
||||||
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§
|
||||||
|
|
||||||
|
# Set the working directory to /app
|
||||||
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
# Install XDebug
|
||||||
|
RUN pecl install xdebug | tail -n 1 | awk -F"\"" '{print $2}' > /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
RUN echo "\n\n[XDebug]\nxdebug.mode=debug\nxdebug.start_with_request=yes\nxdebug.client_host = §DEBUG_REMOTE_IP§\nxdebug.client_port = §DEBUG_REMOTE_PORT§\n" >> /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
|
||||||
|
# Install Memcached
|
||||||
|
RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev \
|
||||||
|
&& pecl install memcached-3.1.5 \
|
||||||
|
&& docker-php-ext-enable memcached
|
||||||
|
|
||||||
|
# Install SOAP
|
||||||
|
RUN docker-php-ext-install soap
|
||||||
|
|
||||||
|
# Copy the current directory contents into the container at /app
|
||||||
|
COPY ./app /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./version /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./config /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
COPY ./install /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
RUN /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
ENTRYPOINT ["§PROJECT_BUILDNAME§-entrypoint"]
|
||||||
|
|
||||||
|
# Make port 80 available to the world outside this container
|
||||||
|
EXPOSE 80
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
FROM §FRAMEWORK_REPOSITORY§/§FRAMEWORK_IMAGE§:§FRAMEWORK_VERSION§-§FRAMEWORK_TYPE§-unit
|
||||||
|
|
||||||
|
WORKDIR /§PROJECT_BUILDNAME§
|
||||||
|
COPY ./app /§PROJECT_BUILDNAME§
|
||||||
|
COPY ./test /test§PROJECT_BUILDNAME§
|
||||||
|
COPY ./version /§PROJECT_BUILDNAME§
|
||||||
|
COPY ./config /§PROJECT_BUILDNAME§
|
||||||
|
COPY ./test/install /§PROJECT_BUILDNAME§
|
||||||
|
|
||||||
|
RUN chmod 744 /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
RUN /§PROJECT_BUILDNAME§/install
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/phpunit"]
|
||||||
|
CMD ["--help"]
|
||||||
@@ -37,4 +37,4 @@ db.notizia.ensureIndex({"about.author": "text",sottotitolo: "text",testo: "text"
|
|||||||
|
|
||||||
db.article_stats.ensureIndex({ "notizia": 1, "time": 1, "deleted": 1 }, {name: "quick_upsert"})
|
db.article_stats.ensureIndex({ "notizia": 1, "time": 1, "deleted": 1 }, {name: "quick_upsert"})
|
||||||
db.banner_stats.ensureIndex({ "banner": 1, "time": 1, "deleted": 1 }, {name: "quick_upsert"})
|
db.banner_stats.ensureIndex({ "banner": 1, "time": 1, "deleted": 1 }, {name: "quick_upsert"})
|
||||||
db.pageview_stats.ensureIndex({ "deleted": 1, "time": 1, "page": 1 }, {name: "quick_upsert"})
|
db.pageview_stats.ensureIndex({ "time": 1, "page": 1, "deleted": 1, }, {name: "quick_upsert"})
|
||||||
|
|||||||
+8
-4
@@ -15,9 +15,10 @@ source "$DIR/../config"
|
|||||||
source "$DIR/libs.sh"
|
source "$DIR/libs.sh"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [-h] [-v] [-t: version] [image type, see below] " 1>&2;
|
echo "Usage: $0 [-h] [-v] [-t: version] -I <webserver|worker> [image type, see below] " 1>&2;
|
||||||
echo "This script builds framework docker images, the following options are available:" 1>&2;
|
echo "This script builds framework docker images, the following options are available:" 1>&2;
|
||||||
echo " -h: This message" 1>&2;
|
echo " -h: This message" 1>&2;
|
||||||
|
echo " -I: Image (webserver or worker)" 1>&2;
|
||||||
echo " Image types (at least one, otherwise the script does nothing)" 1>&2;
|
echo " Image types (at least one, otherwise the script does nothing)" 1>&2;
|
||||||
echo " -a: All, same as ub" 1>&2;
|
echo " -a: All, same as ub" 1>&2;
|
||||||
echo " -u: Unit" 1>&2;
|
echo " -u: Unit" 1>&2;
|
||||||
@@ -33,9 +34,13 @@ UNIT_MODE=0
|
|||||||
DEBUG_MODE=0
|
DEBUG_MODE=0
|
||||||
|
|
||||||
TAG="local"
|
TAG="local"
|
||||||
|
TYPE="webserver"
|
||||||
|
|
||||||
while getopts "t:hvaubd" o; do
|
while getopts "I:t:hvaubd" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
|
I)
|
||||||
|
TYPE="${OPTARG}"
|
||||||
|
;;
|
||||||
b)
|
b)
|
||||||
BASE_MODE=1
|
BASE_MODE=1
|
||||||
;;
|
;;
|
||||||
@@ -66,7 +71,6 @@ while getopts "t:hvaubd" o; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cd ".."
|
cd ".."
|
||||||
|
|
||||||
# STANDARD MODE
|
# STANDARD MODE
|
||||||
@@ -78,7 +82,7 @@ if [[ $BASE_MODE -gt 0 ]]; then
|
|||||||
OPTS+="v"
|
OPTS+="v"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$DIR/generateDockerfile.sh -$OPTS -o $DOCKERFILE
|
$DIR/generateDockerfile.sh -I "${TYPE}" -$OPTS -o $DOCKERFILE
|
||||||
|
|
||||||
msg "Building project image $TAG"
|
msg "Building project image $TAG"
|
||||||
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG -f $DOCKERFILE .
|
docker build -t $PROJECT_REPOSITORY/$PROJECT_GROUP/$PROJECT_BUILDNAME:$TAG -f $DOCKERFILE .
|
||||||
|
|||||||
+18
-9
@@ -116,11 +116,6 @@ if [[ $SELECTED_MODES -ne 1 ]]; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $AUTOTAG -eq 1 ]]; then
|
|
||||||
TAG=`./next-ver.sh -${TAG_OPTS}`
|
|
||||||
echo "Using tag $TAG"
|
|
||||||
fi
|
|
||||||
|
|
||||||
./aws-login.sh
|
./aws-login.sh
|
||||||
|
|
||||||
if [[ $UNIT_MODE -eq 1 ]]; then
|
if [[ $UNIT_MODE -eq 1 ]]; then
|
||||||
@@ -137,18 +132,26 @@ if [[ $UNIT_MODE -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $PUBLISH_MODE -eq 1 ]]; then
|
if [[ $PUBLISH_MODE -eq 1 ]]; then
|
||||||
|
if [[ $AUTOTAG -eq 1 ]]; then
|
||||||
|
TAG=`./next-ver.sh -${TAG_OPTS}`
|
||||||
|
echo "Using tag $TAG"
|
||||||
|
fi
|
||||||
BUILDOPT+="bu"
|
BUILDOPT+="bu"
|
||||||
VERBOPT=""
|
VERBOPT=""
|
||||||
if [[ $VERBOSE -gt 0 ]]; then
|
if [[ $VERBOSE -gt 0 ]]; then
|
||||||
BUILDOPT+="v"
|
BUILDOPT+="v"
|
||||||
VERBOPT="-v"
|
VERBOPT="-v"
|
||||||
fi
|
fi
|
||||||
msg "running ./build.sh -$BUILDOPT -t $TAG"
|
|
||||||
./build.sh -$BUILDOPT -t $TAG
|
|
||||||
|
|
||||||
./run-unit.sh $VERBOPT -t $TAG
|
# WEBSERVER
|
||||||
|
msg "running ./build.sh -I webserver -$BUILDOPT -t $TAG-webserver"
|
||||||
|
./build.sh -I webserver -$BUILDOPT -t "$TAG-webserver"
|
||||||
|
|
||||||
./publish.sh $VERBOPT -t $TAG
|
./run-unit.sh $VERBOPT -t "$TAG-webserver"
|
||||||
|
|
||||||
|
./publish.sh $VERBOPT -t "$TAG-webserver"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ $TAG_IMPLICIT -ne 1 ]]; then
|
if [[ $TAG_IMPLICIT -ne 1 ]]; then
|
||||||
git tag $TAG
|
git tag $TAG
|
||||||
@@ -180,6 +183,9 @@ if [[ $DEBUG_MODE -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $DEPLOY_TEST_MODE -eq 1 ]]; then
|
if [[ $DEPLOY_TEST_MODE -eq 1 ]]; then
|
||||||
|
if [[ $AUTOTAG -eq 1 ]]; then
|
||||||
|
TAG=`./latest-ver.sh -${TAG_OPTS}`
|
||||||
|
fi
|
||||||
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/test"
|
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/test"
|
||||||
mkdir -p $OUT_FOLDER
|
mkdir -p $OUT_FOLDER
|
||||||
./generateComposeFolder.sh -s -o "$OUT_FOLDER" -t $TAG
|
./generateComposeFolder.sh -s -o "$OUT_FOLDER" -t $TAG
|
||||||
@@ -189,6 +195,9 @@ if [[ $DEPLOY_TEST_MODE -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $DEPLOY_PROD_MODE -eq 1 ]]; then
|
if [[ $DEPLOY_PROD_MODE -eq 1 ]]; then
|
||||||
|
if [[ $AUTOTAG -eq 1 ]]; then
|
||||||
|
TAG=`./latest-ver.sh -${TAG_OPTS}`
|
||||||
|
fi
|
||||||
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/production"
|
OUT_FOLDER="/home/$PROJECT_AUTHOR/$PROJECT_BUILDNAME/production"
|
||||||
mkdir -p $OUT_FOLDER
|
mkdir -p $OUT_FOLDER
|
||||||
./generateComposeFolder.sh -p -o "$OUT_FOLDER" -t $TAG
|
./generateComposeFolder.sh -p -o "$OUT_FOLDER" -t $TAG
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ usage() {
|
|||||||
echo " -d: Debug" 1>&2;
|
echo " -d: Debug" 1>&2;
|
||||||
echo " -u: Unit" 1>&2;
|
echo " -u: Unit" 1>&2;
|
||||||
echo " -b: Base" 1>&2;
|
echo " -b: Base" 1>&2;
|
||||||
|
echo " -I: Image (webserver or worker)" 1>&2;
|
||||||
echo " -i: Config Input File" 1>&2;
|
echo " -i: Config Input File" 1>&2;
|
||||||
echo " -o: Output file" 1>&2;
|
echo " -o: Output file" 1>&2;
|
||||||
echo " -v: Verbose" 1>&2;
|
echo " -v: Verbose" 1>&2;
|
||||||
@@ -36,8 +37,13 @@ DEBUG_MODE=0
|
|||||||
UNIT_MODE=0
|
UNIT_MODE=0
|
||||||
BASE_MODE=0
|
BASE_MODE=0
|
||||||
|
|
||||||
while getopts "i:o:hvdub" o; do
|
TYPE="webserver"
|
||||||
|
|
||||||
|
while getopts "i:o:I:hvdub" o; do
|
||||||
case "${o}" in
|
case "${o}" in
|
||||||
|
I)
|
||||||
|
TYPE="${OPTARG}"
|
||||||
|
;;
|
||||||
d)
|
d)
|
||||||
DEBUG_MODE=1
|
DEBUG_MODE=1
|
||||||
SELECTED_MODES+=1
|
SELECTED_MODES+=1
|
||||||
@@ -88,12 +94,12 @@ if [[ $OUTFILE == "" ]]; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
STARTING_FILE="../cicd/dockerfiles/build.dockerfile"
|
STARTING_FILE="../cicd/dockerfiles/${TYPE}/build.dockerfile"
|
||||||
if [[ $DEBUG_MODE -eq 1 ]]; then
|
if [[ $DEBUG_MODE -eq 1 ]]; then
|
||||||
STARTING_FILE="../cicd/dockerfiles/debug.dockerfile"
|
STARTING_FILE="../cicd/dockerfiles/${TYPE}/debug.dockerfile"
|
||||||
fi
|
fi
|
||||||
if [[ $UNIT_MODE -eq 1 ]]; then
|
if [[ $UNIT_MODE -eq 1 ]]; then
|
||||||
STARTING_FILE="../cicd/dockerfiles/test.dockerfile"
|
STARTING_FILE="../cicd/dockerfiles/${TYPE}/test.dockerfile"
|
||||||
fi
|
fi
|
||||||
msg "Using source file $STARTING_FILE"
|
msg "Using source file $STARTING_FILE"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
git pull --quiet
|
||||||
git tag -l --sort=-version:refname | head -n 1
|
git tag -l --sort=-version:refname | head -n 1
|
||||||
Reference in New Issue
Block a user