Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 822f5928 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.6.5

Release 0.6.5

See merge request !4
parents 11d99e61 ff728d22
......@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""
NAME
build_version -- helper script to build and tag a plugin_dbui version
build_version -- helper script to build a plugin_dbui version
SYNOPSIS
build_version [options] version
......@@ -16,7 +16,6 @@
Push version identifier in the javascript library.
Push version number in the CHANGELOG.
Build debug and minified version of the javascript library.
Commit the new version in git and tag it
Build the web2py plugin file
EXAMPLES
......@@ -57,6 +56,7 @@ JSLIBDEBUG = 'static/plugin_dbui/dbui-debug.js'
JSLIBMIN = 'static/plugin_dbui/dbui-min.js'
JSLIBSRC = 'static/plugin_dbui/src'
LATEX = 'latex'
LATEXDOC = opj(DOCS, LATEX)
NOW = datetime.datetime.now()
PACK_PLUGIN_URL = 'http://localhost:8000/%s/default/pack_plugin' % APP
PDF = "pdf"
......@@ -118,16 +118,14 @@ def build_pdf(doc):
"""
print "Build the PDF documentations..."
latexdoc = opj(DOCS, LATEX)
# generate the latex
sphinx("-b latex", opj(DOCSRC, doc), latexdoc)
sphinx("-b latex", opj(DOCSRC, doc), LATEXDOC)
# the current directory
cwd = os.getcwd()
# find the name of the tex file
os.chdir(latexdoc)
os.chdir(LATEXDOC)
li = [el for el in os.listdir('.') if el.endswith('.tex')]
fn = (li[0] if len(li) == 1 else None)
......@@ -141,22 +139,20 @@ def build_pdf(doc):
# move the pdf file
os.chdir(cwd)
pdfdir = opj(DOCS, PDF)
if not os.path.exists(pdfdir):
os.mkdir(pdfdir)
if not os.path.exists(PDFDOC):
os.mkdir(PDFDOC)
fin = fn.replace('.tex', '.pdf')
fout = "%s_%s.pdf" % (os.path.splitext(fn)[0], doc)
os.rename(opj(latexdoc, fin), opj(pdfdir, fout))
os.rename(opj(LATEXDOC, fin), opj(PDFDOC, fout))
# remove the latex directory
call(["rm", "-rf", latexdoc])
call(["rm", "-rf", LATEXDOC])
print "PDF documentation in", PDFDOC
print "%s documentation in" % fout, PDFDOC
def change_log():
def commit_change_log():
"""Commit CHANGELOG and App.js.
"""
......@@ -166,106 +162,18 @@ def change_log():
print '\tSkip this step.\n'
return
# move to the master branch
git("checkout master")
# Commit modified files
print 'git add', JSBASE, CHANGELOG
git("add", JSBASE, CHANGELOG)
print 'git commit'
msg = "Start release cycle %s" % get_version()
msg = "Start release candidate %s" % get_version()
git("commit -m", msg)
def close_feature():
"""Close the feature cycle.
"""
print "Close the feature cycle..."
print "Current branches are:"
git("branch")
rep = raw_input("Select the feature identifier:")
if not rep:
sys.exit(0)
branch = "feature-%s" % rep
git("checkout develop")
git("merge --no-ff", branch)
rep = raw_input("Delete the locale branch %s [y/N]", branch)
if rep == 'y':
git("branch -d", branch)
def close_hotfix():
"""Close the hotfix cycle.
"""
print "Close the hotfix cycle..."
print "Current branches are:"
git("branch")
release = raw_input("Select the hotfix identifier:")
if not release:
sys.exit(0)
branch = "hotfix-%s" % release
git("checkout master")
git("merge --no-ff", branch)
msg = "Release %s" % release
git("tag -a", release, "-m", msg)
git("checkout develop")
git("merge --no-ff", branch)
rep = raw_input("Delete branch %s [y/N]:" % branch)
if rep == "y":
git("branch -d", branch)
git("checkout master")
build()
web2py()
print "The hotfix cycle ", release, "is over"
def close_release():
"""Close the release cycle.
"""
print "Close the release cycle..."
print "Current branches are:"
git("branch")
release = raw_input("Select the release identifier:")
if not release:
sys.exit(0)
branch = "release-%s" % release
msg = "Release %s" % release
print msg
git("checkout develop")
git("merge --no-ff", branch, "-m", msg)
git("checkout master")
git("merge --no-ff", branch, "-m", msg)
git("tag -a", release, "-m", msg)
rep = raw_input("Delete branch %s [y/N]:" % branch)
if rep == "y":
git("branch -d", branch)
build()
web2py()
print "The release cycle ", release, "is over"
def compile_js():
"""compile_js the javascript code and generate the debug version
as well as the minified version of the dbui library.
......@@ -486,41 +394,12 @@ def sphinx(*args, **kwargs):
call(cmd, **kwargs)
def start_feature():
"""Start the feature cycle.
"""
print "Start the feature cycle..."
rep = raw_input("Enter the feature identifier:")
if not rep:
sys.exit(0)
branch = "feature-%s" % rep
git("checkout -b", branch, "develop")
def start_hotfix():
"""Start the hotfix cycle.
"""
print "Start the hotfix cycle..."
print "The current release is", get_version()
rep = raw_input("Enter the hotfix release identifer:")
if not rep:
sys.exit(0)
branch = "hotfix-%s" % rep
git("checkout -b", branch, "master")
set_version(rep)
change_log()
def start_release():
"""Start the release cycle.
Set the new release number in the CHANGELOG and App.js files.
Commit then in the master branch.
"""
print "Start the release cycle..."
......@@ -535,23 +414,30 @@ def start_release():
git("checkout", "-b", branch, "develop")
set_version(new_release)
change_log()
commit_change_log()
build()
def tag():
"""Tag the current release in git.
"""Tag the release in the production branch, locally and on the
remote repository.
"""
print "Tag the release...",
version = get_version()
msg = "Tag %s" % version
# move to production branch
git("checkout", "production")
# annotated tag
version = get_version()
print 'git tag', version
msg = "Tag %s" % version
git("tag", "-a", version, "-m", msg)
# push the tag on the server
git("push --tags")
def web2py():
"""Produce the binary file for the web2py plugin.
......@@ -593,41 +479,11 @@ if __name__ == '__main__':
dest="api_doc",
help="build the API documentation in HTML.")
OPS.add_option("--api-pdf",
OPS.add_option("-A", "--api-pdf",
action="store_true",
dest="api_pdf",
help="build the API documentation in PDF.")
OPS.add_option("--start-feature",
action="store_true",
dest="start_feature",
help="start the feature cycle.")
OPS.add_option("--start-hotfix",
action="store_true",
dest="start_hotfix",
help="start the hotfix cycle.")
OPS.add_option("--start-release",
action="store_true",
dest="start_release",
help="start the new release branch cycle.")
OPS.add_option("--close-hotfix",
action="store_true",
dest="close_hotfix",
help="close the hotfix branch cycle.")
OPS.add_option("--close-feature",
action="store_true",
dest="close_feature",
help="close the feature branch cycle.")
OPS.add_option("--close-release",
action="store_true",
dest="close_release",
help="close the release branch cycle.")
OPS.add_option("-c", "--compile",
action="store_true",
dest="compile",
......@@ -636,7 +492,8 @@ if __name__ == '__main__':
OPS.add_option("--commit-changelog",
action="store_true",
dest="changelog",
help="commit CHANGELOG and App.js.")
help="commit CHANGELOG and App.js. "
"To be used with --write-release.")
OPS.add_option("-j", "--jsduck",
action="store_true",
......@@ -648,27 +505,32 @@ if __name__ == '__main__':
dest="reference_doc",
help="build the reference manual in HTML.")
OPS.add_option("--reference-pdf",
OPS.add_option("-R", "--reference-pdf",
action="store_true",
dest="reference_pdf",
help="build the reference manual in PDF.")
OPS.add_option("--write-release",
OPS.add_option("-s", "--start-release",
action="store_true",
dest="release",
help="write the release number in CHANGELOG and App.js.")
dest="start_release",
help="start the release candidate by setting "
"release number in change log and App.js. "
"Commit changes in the master branch. "
"Equivalent to --write-release followed by "
"--commit-changelog.")
OPS.add_option("--tag",
OPS.add_option("-t", "--tag",
action="store_true",
dest="tag",
help="tag the release in git.")
help="tag the release in the production branch "
"locally and on the remote repository.")
OPS.add_option("-u", "--user-doc",
action="store_true",
dest="user_doc",
help="build the user manual in HTML.")
OPS.add_option("--user-pdf",
OPS.add_option("-U", "--user-pdf",
action="store_true",
dest="user_pdf",
help="build the user manual in PDF.")
......@@ -681,21 +543,23 @@ if __name__ == '__main__':
OPS.add_option("-w", "--web2py",
action="store_true",
dest="web2py",
help="pack the web2py plugin.")
help="pack the plugin_dbui.")
OPS.add_option("--write-release",
action="store_true",
dest="release",
help="write the release number in CHANGELOG and App.js. "
"To be used with --commit-changelog.")
OPS.set_defaults(api_doc=False,
api_pdf=False,
close_feature=False,
close_hotfix=False,
close_release=False,
changelog=False,
compile=False,
jsduck=False,
reference_doc=False,
reference_pdf=False,
release=False,
start_feature=False,
start_hotfix=False,
start_release=False,
tag=False,
user_doc=False,
......@@ -710,20 +574,11 @@ if __name__ == '__main__':
if OPT.api_pdf:
build_pdf(API)
if OPT.close_feature:
close_feature()
if OPT.close_hotfix:
close_hotfix()
if OPT.close_release:
close_release()
if OPT.compile:
compile_js()
if OPT.changelog:
change_log()
commit_change_log()
if OPT.jsduck:
jsduck()
......@@ -737,15 +592,12 @@ if __name__ == '__main__':
if OPT.reference_pdf:
build_pdf(REFERENCE)
if OPT.start_feature:
start_feature()
if OPT.start_hotfix:
start_hotfix()
if OPT.start_release:
start_release()
if OPT.tag:
tag()
if OPT.user_doc:
sphinx("-b html", opj(DOCSRC, USER), opj(DOCS, USER))
......
......@@ -226,6 +226,8 @@ def documentations():
"""
from plugin_dbui import get_reference_paths, Store
plugin = plugins.dbui
# alias
a = '<a href="%s" target="_blank">%s</a>'
......@@ -295,16 +297,19 @@ def documentations():
cfg.fields = [dict(name='code', type='string'),
dict(name='source', type='string')]
src = ""
if plugin.app_git:
src = "<em>git clone %s</em>" % plugin.app_git
r1 = dict(code=request.application,
source="<em>git clone http://www.cppm.in2p3.fr/~legac/wap/git/"
"%s.git</em>" % request.application)
source=src)
r2 = dict(code="plugin_dbui",
source="<em>git clone http://www.cppm.in2p3.fr/~legac/wap/git/"
"web2py_plugin_dbui.git</em>")
source="<em>git clone https://gitlab.in2p3.fr/legac/"
"plugin_dbui.git</em>")
r3 = dict(code="Web2py",
source="<em>git clone git://github.com/web2py/web2py.git</em>")
source="<em>git clone https://github.com/web2py/web2py.git</em>")
r4 = dict(code="Ext JS",
source="<em>Download from the Ext JS web site. </em><br>"
......
.. include:: hyperlinks.txt
Introduction
==============
============
The plugin ``plugin_dbui`` bridges the web2py framework and Ext JS library.
It connects your model to the Ext JS widgets and to the web2py
......@@ -56,7 +56,7 @@ version number.
The plugin_dbui and its friends can be obtained using the versioning tool git_::
git clone http://www.cppm.in2p3.fr/~legac/wap/git/plugin_dbui_build.git
git clone http://gitlab.in2p3.fr/legac/plugin_dbui_build.git
* Install the ``plugin_dbui`` in your application using the web2py
administration interface.
......@@ -97,7 +97,7 @@ Source code
The source code of ``plugin_dbui`` can be obtained using the versioning tool
git_::
git clone http://www.cppm.in2p3.fr/~legac/wap/git/web2py_plugin_dbui.git
git clone http://gitlab.in2p3.fr/legac/plugin_dbui.git
This is a complete web2py application which can be used as an example.
......
......@@ -5,7 +5,7 @@
import locale
import plugin_dbui as dbui
from callbacks import country_delete, country_insert, country_update
from callbacks import country_delete, country_insert, country_update
from datetime import datetime
from gluon.tools import PluginManager
......@@ -15,22 +15,23 @@ from gluon.tools import PluginManager
#
#-------------------------------------------------------------------------------
plugins = PluginManager()
#plugins.dbui.app_css = None # relative path, i.e static/myapp.css or dir or list
#plugins.dbui.app_js = None # relative path static/src/my.js or dir or list
#plugins.dbui.app_libmin = None # relative path static/myapp-min.js or dir or list
plugins.dbui.app_script = 'static/app.js' # relative path static/myapp.js
# plugins.dbui.app_css = None # relative path, i.e static/myapp.css or dir or list
# plugins.dbui.app_js = None # relative path static/src/my.js or dir or list
plugins.dbui.app_git = "https://gitlab.in2p3.fr/legac/%s.git" % request.application
# plugins.dbui.app_libmin = None # relative path static/myapp-min.js or dir or list
plugins.dbui.app_script = 'static/app.js' # relative path static/myapp.js
plugins.dbui.app_script_dir = 'static/scripts' # relative directory static/scripts
#plugins.dbui.dbui_libmin='static/plugin_dbui/dbui-debug.js'
# plugins.dbui.dbui_libmin='static/plugin_dbui/dbui-debug.js'
#-------------------------------------------------------------------------------
#
# LANGUAGE
#
#-------------------------------------------------------------------------------
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8")
......@@ -65,4 +66,4 @@ dbui.configure_forms(tables, plugins=['pFormToolTip'],
dbui.configure_grids(tables, plugins=['pGridRowEditorConfirmDelete',
'pGridRowEditorContextMenu',
'pGridRowEditorDblClick',
'pGridToolbar'])
'pGridToolbar'])
\ No newline at end of file
""" plugin_dbui
Initialize the plugin_dbui
Define persistent storage, main services
Define persistent storage, main services
and methods available on the client side.
"""
import plugin_dbui as dbui
......@@ -12,7 +12,7 @@ from gluon.storage import Storage
from gluon.tools import PluginManager
# NOTE:
# define default configuration parameters for the plugin,
# define default configuration parameters for the plugin,
# the application using it and the persistent storage used to tune the widgets.
# In most of the case configuration parameters are either a relative path
# to a file (static/myapp.css) or to a directory (static/css) except app_script
......@@ -27,17 +27,18 @@ from gluon.tools import PluginManager
lg = dbui.get_language()
plugins = PluginManager('dbui',
app_css=None, # relative path static/myapp.css or dir or list
app_debug=None, # relative path static/src/my.js or dir or list
app_lg=None, # relative path or dir or list
app_libmin=None, # relative path static/myapp-min.js or dir
app_script=None, # relative path static/myapp.js
app_script_dir=None, # relative directory static/scripts
app_css=None, # relative path static/myapp.css or dir or list
app_debug=None, # relative path static/src/my.js or dir or list
app_git=None,
app_lg=None, # relative path or dir or list
app_libmin=None, # relative path static/myapp-min.js or dir
app_script=None, # relative path static/myapp.js
app_script_dir=None, # relative directory static/scripts
dbui_conf=URL(c='plugin_dbui', f='dbui_conf'),
dbui_conf_debug=URL(c='plugin_dbui',
f='dbui_conf',
dbui_conf_debug=URL(c='plugin_dbui',
f='dbui_conf',
vars=dict(debug="")),
dbui_css=['static/plugin_dbui/resources/css/kde-oxygen.css',
'static/plugin_dbui/resources/css/dbui.css'],
......@@ -45,10 +46,10 @@ plugins = PluginManager('dbui',
dbui_lg='static/plugin_dbui/locale/dbui-lang-%s.js' % lg,
dbui_libmin='static/plugin_dbui/dbui-min.js',
dbui_script='static/plugin_dbui/main.js',
ace_libmin='static/plugin_ace/src-min-noconflict/ace.js',
ace_css='static/plugin_ace/css/editor.css',
extjs_css='static/plugin_extjs/resources/css/ext-all.css',
extjs_debug='static/plugin_extjs/ext-dev.js',
extjs_libmin='static/plugin_extjs/ext-all.js',
......@@ -61,9 +62,9 @@ plugins = PluginManager('dbui',
modifier_grids={},
modifier_stores={},
modifier_viewports=Storage(extjs={}),
static_stores={})
# Start common services
dbSvc = dbui.DbSvc()
......@@ -80,29 +81,29 @@ def close_user_session():
return dbui.close_user_session()
@directSvc.register
def getForm(tablename):
def getForm(tablename):
return dbui.to_formPanel(db[tablename])
@directSvc.register
def getGrid(tablename):
def getGrid(tablename):
return dbui.to_gridPanel(db[tablename])
@directSvc.register
def create(data):
def create(data):
return dbSvc.create(data)
@directSvc.register
def count(data):
def count(data):
return dbSvc.count(data)
@directSvc.register
def destroy(data):
def destroy(data):
return dbSvc.destroy(data)
@directSvc.register
def read(data):
def read(data):
return dbSvc.read(data)
@directSvc.register
def update(data):
return dbSvc.update(data)
\ No newline at end of file