Commit eaf09e55 authored by Alessandro Viprati's avatar Alessandro Viprati

Merge branch 'scopri-ubuntu' of code.ubuntu-it.org:ubuntu-it-web/www into scopri-ubuntu

parents 425998a6 4d2b928a
Pipeline #150 passed with stage
in 0 seconds
{
"build": [
["invoke", "build"]
],
"before_install": [
["mkdir", "{{base}}/data"],
["virtualenv", "-p", "python3", "{{base}}/env"]
],
"install": [
{
"artifacts": "build/packages/*.whl",
"command": ["{{base}}/env/bin/pip", "install", "{{artifact}}"]
}
],
"after_install": [
["{{base}}/env/bin/uitwww", "init", "{{base}}/data"]
["./run", "build_scss"],
["./run", "init", "{{base}}/data"]
],
"run": [
"{{base}}/env/bin/uitwww", "run", "-g", "{{gunicorn_config_file}}",
"{{base}}/build/run", "run",
"-g", "{{gunicorn_config_file}}",
"{{base}}/data"
]
}
#! /usr/bin/python3
import os
import sys
# Prefer local modules over any system-installed ones to ensure that running a
# Git version from any current working directory does not have unexpected
# behaviour.
parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if os.path.exists(os.path.join(parent, 'uitwww', '__init__.py')):
sys.path.insert(0, parent)
if __name__ == '__main__':
from uitwww import main
main.cli()
......@@ -49,7 +49,7 @@ setuptools.setup(
entry_points = {
"console_scripts": [
"uitwww = uitwww.__main__:cli",
"uitwww = uitwww.main:cli",
],
},
......
......@@ -3,12 +3,12 @@
# necessario aggiornare questa sezione.
[releases.latest]
version = "18.04.1"
version = "18.04.2"
codename = "bionic"
lts = true
[releases.lts]
version = "16.04.5"
version = "16.04.6"
codename = "xenial"
lts = true
......@@ -109,14 +109,14 @@ releases = ["latest"]
archs = { amd64 = "cdimages-derivatives", i386 = "cdimages-derivatives" }
[distros.ubuntustudio]
name = "Ubuntu Studio"
description = "Ubuntu con tutti i programmi per lavorare con audio, video e immagini"
lts-support-years = 3
lts-only = true
releases = ["lts"]
archs = { amd64 = "cdimages-studio", i386 = "cdimages-studio" }
#[distros.ubuntustudio]
#name = "Ubuntu Studio"
#description = "Ubuntu con tutti i programmi per lavorare con audio, video e immagini"
#lts-support-years = 3
#
#lts-only = true
#releases = ["lts"]
#archs = { amd64 = "cdimages-studio", i386 = "cdimages-studio" }
......
......@@ -15,8 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
import sys
import click
import subprocess
import uitwww
from uitwww import utils
......@@ -80,3 +82,20 @@ def init(data):
print("Initializing data directory:", data)
data_path = os.path.expanduser(os.path.abspath(data))
uitwww.init_data_directory(data_path)
@cli.command("build_scss")
def build_scss():
"""Build the scss file"""
base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
scss_file = open('%s/assets/scss/www.scss' % base_dir, 'rb')
css_file = open('%s/uitwww/static/website.css' % base_dir, 'wb')
subprocess.run(
[sys.executable, '-mscss'],
stdin=scss_file,
stdout=css_file,
check=True,
)
css_file.flush()
scss_file.close()
css_file.close()
......@@ -18,7 +18,7 @@ import datetime
import random
import string
from htmlmin.minify import html_minify
from htmlmin import minify as html_minify
import gunicorn.app.base as baseapp
......
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