Skip to content
Snippets Groups Projects
Commit ac9c033a authored by Jan Mach's avatar Jan Mach
Browse files

Updated grunt tasks to enable building and packaging Hawat interface in our automated build system.

(Redmine issue: #3387)
parent 23e70e4e
No related branches found
No related tags found
No related merge requests found
...@@ -70,11 +70,27 @@ module.exports = function(grunt) { ...@@ -70,11 +70,27 @@ module.exports = function(grunt) {
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// Running shell commands. // Running shell commands.
shell: { shell: {
// Update NodeJS packages (Grunt and grunt plugins) // Update NodeJS packages (Grunt and grunt plugins).
npm_update: { npm_update: {
command: 'npm update' command: 'npm update'
}, },
// Calculate directory size, willbe used in DEB package metadata. // Install Yarn managed packages (web interface frontend packages).
yarn_install: {
command: 'yarn install'
},
// Upgrade Yarn managed packages (web interface frontend packages).
yarn_upgrade: {
command: 'yarn upgrade'
},
// Clean precompiled Python modules.
pyclean: {
command: 'find lib/ -name *.pyc -delete'
},
// Compile language dictionaries.
pybabel: {
command: 'pybabel-python3 compile -d lib/hawat/translations'
},
// Calculate directory size, will be used in DEB package metadata.
dir_size: { dir_size: {
command: '/usr/bin/du -k -s <%= project_paths.package_dir %> | /usr/bin/cut -f 1', command: '/usr/bin/du -k -s <%= project_paths.package_dir %> | /usr/bin/cut -f 1',
options: { options: {
...@@ -166,9 +182,9 @@ module.exports = function(grunt) { ...@@ -166,9 +182,9 @@ module.exports = function(grunt) {
// ----- Copy libraries to appropriate package location. // ----- Copy libraries to appropriate package location.
{ {
expand: true, expand: true,
cwd: 'lib/mentat/', cwd: 'lib/',
src: './**', src: './**',
dest: '<%= project_paths.package_dir %><%= paths_deb.lib_dir %>mentat/' dest: '<%= project_paths.package_dir %><%= paths_deb.lib_dir %>'
}, },
// ----- Copy Debian package meta files to appropriate package location. // ----- Copy Debian package meta files to appropriate package location.
{ {
...@@ -319,11 +335,11 @@ module.exports = function(grunt) { ...@@ -319,11 +335,11 @@ module.exports = function(grunt) {
grunt.registerTask('deb-build', grunt.registerTask('deb-build',
'(RUN) Build Debian packages for Mentat-ng system.', '(RUN) Build Debian packages for Mentat-ng system.',
['check-version', 'clean:build', 'shell:deb_archive', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build'] ['check-version', 'shell:pyclean', 'clean:build', 'shell:deb_archive', 'webui', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build']
); );
grunt.registerTask('deb-buildbot', grunt.registerTask('deb-buildbot',
'(RUN) Build Debian packages for Mentat-ng system by Buildbot automation system.', '(RUN) Build Debian packages for Mentat-ng system by Buildbot automation system.',
['check-version', 'clean:build', 'shell:deb_archive', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build'] ['check-version', 'shell:pyclean', 'clean:build', 'shell:deb_archive', 'webui', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build']
); );
grunt.registerTask('deb-scp-upload', grunt.registerTask('deb-scp-upload',
'(RUN) Upload latest Debian packages to repository server, development server and demo server.', '(RUN) Upload latest Debian packages to repository server, development server and demo server.',
...@@ -351,11 +367,11 @@ module.exports = function(grunt) { ...@@ -351,11 +367,11 @@ module.exports = function(grunt) {
); );
grunt.registerTask('update', grunt.registerTask('update',
'(RUN) Update internal NPM packages for build suite.', '(RUN) Update internal NPM packages for build suite.',
['shell:npm_update'] ['shell:npm_update', 'shell:yarn_install']
); );
grunt.registerTask('webui', grunt.registerTask('webui',
'(RUN) Build and install web user interface dependencies.', '(RUN) Build and install web user interface dependencies.',
['clean:webui', 'copy:webui'] ['shell:yarn_install', 'shell:pybabel', 'clean:webui', 'copy:webui']
); );
grunt.registerTask('default', grunt.registerTask('default',
'(RUN) Alias for deb-build, only build Debian packages.', '(RUN) Alias for deb-build, only build Debian packages.',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment