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

Removed unnecessary tasks and functions from Gruntfile.

There were deprecated deployment related tasks in Gruntfile related to previous package building and deployment mechanism. There are no longer valid and used, so I have removed them to make the file more clear. All package build and deployment related tasks should be moved to master makefile and Grunt should be used only to the stuff related to web interface. So the next task will be to rewrite the Debian package generation into the master makefile. (Redmine issue: #4216,#3387)
parent 22d814dd
No related branches found
No related tags found
No related merge requests found
...@@ -93,10 +93,6 @@ module.exports = function(grunt) { ...@@ -93,10 +93,6 @@ module.exports = function(grunt) {
yarn_install: { yarn_install: {
command: 'yarn install' command: 'yarn install'
}, },
// Upgrade Yarn managed packages (web interface frontend packages).
yarn_upgrade: {
command: 'yarn upgrade'
},
// Clean precompiled Python modules. // Clean precompiled Python modules.
pyclean: { pyclean: {
command: 'find lib/ -name *.pyc -delete' command: 'find lib/ -name *.pyc -delete'
...@@ -115,54 +111,10 @@ module.exports = function(grunt) { ...@@ -115,54 +111,10 @@ module.exports = function(grunt) {
callback: cbk_dir_size callback: cbk_dir_size
} }
}, },
// Archive previously built DEB packages from build directory.
deb_archive: {
command: 'pkgs=`find <%= project_paths.deploy_dir %> -maxdepth 1 -name *.deb` && if [ -n "$pkgs" ]; then mv -f <%= project_paths.deploy_dir %>*.deb <%= project_paths.archive_dir %>; fi;'
},
// Build DEB package. // Build DEB package.
deb_build: { deb_build: {
command: '/usr/bin/fakeroot /usr/bin/dpkg-deb --build <%= project_paths.package_dir %> <%= project_paths.deploy_dir %>' + deb_package_filename() command: '/usr/bin/fakeroot /usr/bin/dpkg-deb --build <%= project_paths.package_dir %> <%= project_paths.deploy_dir %>' + deb_package_filename()
}, },
// Duplicate package from deb_package_filename() to deb_package_latest_filename().
deb_duplicate: {
command: 'cp -f <%= project_paths.deploy_dir %>' + deb_package_filename() + ' <%= project_paths.deploy_dir %>' + deb_package_latest_filename()
},
// SCP deployment - upload built DEB packages to repository server.
deb_scp_upload_repo: {
command: '/usr/bin/scp <%= project_paths.deploy_dir %>' + deb_package_filename() + ' <%= meta.pkg_server %>:<%= meta.pkg_location %>/stable'
},
// SCP deployment - upload built DEB packages to development server.
deb_scp_upload_dev: {
command: '/usr/bin/scp <%= project_paths.deploy_dir %>' + deb_package_filename() + ' <%= meta.dev_server %>:<%= meta.dev_location %>'
},
// SCP deployment - upload built DEB packages to demo server.
deb_scp_upload_demo: {
command: '/usr/bin/scp <%= project_paths.deploy_dir %>' + deb_package_filename() + ' <%= meta.demo_server %>:<%= meta.demo_location %>'
},
// Refresh DEB repository metadata on repository server.
repo_refresh: {
command: '/usr/bin/ssh mach@<%= meta.pkg_server %> apt-update mentat'
},
// Install latest package via APT on production server - step 1.
ssh_apt_update_prod: {
command: '/usr/bin/ssh root@<%= meta.dep_server %> aptitude update'
},
// Install latest package via APT on production server - step 2.
ssh_apt_install_prod: {
command: '/usr/bin/ssh root@<%= meta.dep_server %> aptitude install mentat-ng'
},
// Install latest package via DPKG on local system.
dpkg_install_local: {
command: 'sudo dpkg -i <%= project_paths.deploy_dir %>' + deb_package_filename()
},
// Install latest package via DPKG on development server.
dpkg_install_dev: {
command: '/usr/bin/ssh root@<%= meta.dev_server %> dpkg -i <%= meta.dev_location %>/' + deb_package_filename()
},
// Install latest package via DPKG on demo server.
dpkg_install_demo: {
command: '/usr/bin/ssh root@<%= meta.demo_server %> dpkg -i <%= meta.demo_location %>/' + deb_package_filename()
},
}, },
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
...@@ -581,48 +533,24 @@ module.exports = function(grunt) { ...@@ -581,48 +533,24 @@ module.exports = function(grunt) {
// Setup custom task(s). // Setup custom task(s).
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
grunt.registerTask('deb-buildbot', grunt.registerTask(
'(RUN) Build Debian packages for Mentat-ng system by Buildbot automation system.', 'deb-build',
['check-version', 'shell:pyclean', 'clean:build', 'shell:deb_archive', 'shell:pybabel_mentat', 'webui', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build'] '(RUN) Build Debian packages for Mentat-ng system.',
); ['check-version', 'shell:pyclean', 'clean:build', 'shell:pybabel_mentat', 'webui', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build']
grunt.registerTask('deb-scp-upload',
'(RUN) Upload latest Debian packages to repository server, development server and demo server.',
['shell:deb_scp_upload_repo', 'shell:repo_refresh', 'shell:deb_scp_upload_dev', 'shell:deb_scp_upload_demo']
);
grunt.registerTask('deb-ssh-install',
'(RUN) Install latest Debian packages on local system and development and demo servers.',
['shell:dpkg_install_local', 'shell:dpkg_install_dev', 'shell:dpkg_install_demo']
);
grunt.registerTask('deb-deploy',
'(RUN) Build Debian packages for Mentat-ng system, upload them to repository, development and demo servers and install them.',
['deb-build', 'deb-scp-upload', 'deb-ssh-install']
);
grunt.registerTask('deb-deploy-local',
'(RUN) Build Debian packages for Mentat-ng system and install them on local system.',
['deb-build', 'shell:dpkg_install_local']
);
grunt.registerTask('deb-deploy-dev',
'(RUN) Build Debian packages for Mentat-ng system and upload and install them on development server.',
['deb-build', 'shell:deb_scp_upload_dev', 'shell:dpkg_install_dev']
);
grunt.registerTask('deb-deploy-demo',
'(RUN) Build Debian packages for Mentat-ng system and upload and install them on demo server.',
['deb-build', 'shell:deb_scp_upload_demo', 'shell:dpkg_install_demo']
);
grunt.registerTask('update',
'(RUN) Update internal NPM packages for build suite.',
['shell:yarn_install', 'shell:yarn_upgrade']
);
grunt.registerTask('webui',
'(RUN) Build and install web user interface dependencies.',
['shell:yarn_install', 'shell:pybabel_hawat', 'clean:webui', 'copy:webui', 'comments', 'minify-cldrs']
);
grunt.registerTask('build',
'(RUN) Build Debian packages for Mentat-ng system.',
['check-version', 'shell:pyclean', 'clean:build', 'shell:deb_archive', 'shell:pybabel_mentat', 'webui', 'copy:deb', 'chmod', 'shell:dir_size', 'template:deb-control', 'shell:deb_build', 'clean:build']
); );
grunt.registerTask('default', grunt.registerTask(
'(RUN) Alias for deb-build, only build Debian packages.', 'deb-buildbot',
['deb-build'] '(RUN) Build Debian packages for Mentat-ng system by Buildbot automation system.',
['deb-build']
);
grunt.registerTask(
'webui',
'(RUN) Build and install web user interface dependencies.',
['shell:yarn_install', 'shell:pybabel_hawat', 'clean:webui', 'copy:webui', 'comments', 'minify-cldrs']
); );
grunt.registerTask(
'default',
'(RUN) Alias for webui.',
['webui']
);
}; };
{ {
"architecture": "all", "architecture": "all"
"pkg_server": "homeproj",
"pkg_location": "/var/reps/apt/certs/incoming",
"dev_server": "mentat-dev",
"dev_location": "/root",
"demo_server": "mentat-demo",
"demo_location": "/root",
"dep_server": "mentat-hub"
} }
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