0
1
Fork 0

Bugs fixed

This commit is contained in:
Juan 2018-04-21 15:13:05 +02:00
parent ba802341db
commit df56173dd7
7 changed files with 12 additions and 80 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.405.84) stable; urgency=low
hedera-web (1.405.85) stable; urgency=low
* Initial Release.

5
deploy Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
set -e
vn-debuild
vn-deploy www1.static www2.static

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.405.84",
"version": "1.405.85",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -1,55 +0,0 @@
#!/bin/bash
set -e
baseDir=$(dirname "$0")
gitDir="$baseDir/.."
projectName=$(basename "$(realpath "$gitDir")")
buildDir="/tmp/git-deploy/$projectName"
srcDir="$buildDir/src"
repreproDir="/var/cache/reprepro"
codename="stable"
logFile="$buildDir/deploy.log"
echo "Building source code."
echo " * Directory $buildDir"
rm -f "$logFile"
mkdir -p "$srcDir"
git --work-tree="$srcDir" --git-dir="$gitDir" checkout -f
if [ -f "$srcDir/package.json" ]
then
echo "Installing Node dependencies."
(cd "$srcDir" && npm --silent install >> "$logFile")
fi
if [ -f "$srcDir/debian/changelog" ]
then
echo "Cleaning last build."
rm -f $buildDir/*.deb
rm -f $buildDir/*.changes
rm -f $buildDir/*.build
(cd "$srcDir" && debian/rules clean >> "$logFile")
echo "Building Debian packages."
(cd "$srcDir" && debuild -uc -us -b >> "$logFile")
echo "Adding packages to repository."
packages=""
cut -d" " -f1 "$srcDir/debian/files" |
while read debFile
do
if [[ ! "$debFile" =~ .*\.deb$ ]]
then
continue
fi
packageName=$(echo $debFile | cut -d"_" -f1)
packages="$packages $packageName"
echo " * Adding $debFile"
reprepro -b "$repreproDir" includedeb $codename "$buildDir/$debFile" >> "$logFile"
done
fi

View File

@ -1,21 +0,0 @@
#!/bin/bash
set -e
packages=$1
hosts="www1.static.verdnatura.es www2.static.verdnatura.es"
if [ -z "$packages" ]
then
echo "Usage: $(basename $0) package_name..."
exit 1
fi
# FIXME: Packages are not upgraded when config files are changed
echo "Upgrading servers."
for host in $hosts
do
echo " * Upgrading $host"
ssh root@$host "update-repo vn && apt-get install $packages >> /dev/null"
done

View File

@ -44,6 +44,7 @@ class HtmlService extends Service
$updateBrowser = FALSE;
if (!isset ($_GET['skipBrowser'])
&& isset($_SERVER['HTTP_USER_AGENT'])
&& ($browser = get_browser ($_SERVER['HTTP_USER_AGENT'])))
{
$browserVersion = (double) $browser->version;

View File

@ -5,6 +5,8 @@ $version = $this->getVersion();
function getUrl ($fileName)
{
global $version;
if (file_exists ($fileName))
$fileVersion = strftime ('%G%m%d%H%M%S', filemtime ($fileName));
else
@ -15,12 +17,12 @@ function getUrl ($fileName)
function js ($fileName)
{
return '<script type="text/javascript" src="'. getUrl ($fileName) .'.js"></script>'."\n";
return '<script type="text/javascript" src="'. getUrl ("$fileName.js") .'"></script>'."\n";
}
function css ($fileName)
{
return '<link rel="stylesheet" type="text/css" href="'. getUrl ($fileName) .'.css"/>'."\n";
return '<link rel="stylesheet" type="text/css" href="'. getUrl ("$fileName.css") .'"/>'."\n";
}
function getWebpackAssets ()