Automated deploying files to Kurtosys CMS
- First argument: site config
- Second argument: user credentials file
Example usage: phantomjs ddeploy.js cms_config_uat.js cms_user_uat.js
NOTE: all property values are case-sensitive!
exports.config = {
"url": "http://website.com/",
"client": "someclient",
"website": "somewebsite",
"publish_type": 1, // 0: manual publish, 1: whole website, 2: only changed web pages
"components": [
{
"local": "a.txt",
"remote": "a file",
"type": "Text component",
"webpage": "somewebpage" // optional for deployment (prev/publish)
},
{
"local": "b.txt",
"remote": "b file",
"type": "Text component",
"webpage": "somewebpage" // optional for deployment (prev/publish)
},
{
"local": "c.txt",
"remote": "c file",
"type": "Text component",
"webpage": "somewebpage" // optional for deployment (prev/publish)
}
]
}
exports.username = "yourname";
exports.password = "yourpassword"
Don't forget to add this file to ignore in version control!
- Install
grunt-exec
- Include
grunt.loadNpmTasks('grunt-exec');
inGruntfile.js
- Create a Grunt task in
Gruntfile.js
(insidegrunt.initConfig({ ... })
block)
exec: {
deploy_to_fundnet_uat: {
command: 'phantomjs ddeploy.js cms_config_uat.js cms_user_uat.js'
},
deploy_to_fundnet_prod: {
command: 'phantomjs ddeploy.js cms_config_prod.js cms_user_prod.js'
}
}
- Then register the tasks
grunt.registerTask('ddeploy-uat', [
'exec:deploy_to_fundnet_uat'
]);
grunt.registerTask('ddeploy-prod', [
'exec:deploy_to_fundnet_prod'
]);
- You can now run
grunt ddeploy-uat
orgrunt ddeploy-prod
to deploy files to CMS
- "Article" content type
- handle change password page
- check which file changed since the last publish, publish only the newly changed files
- error handling
- :contains might not work properly with Text Component name "Test" and "Test 2" -- cause it's not exact mactch
- get website by "Belongs to" tab content - and preview/publish by that
- textComponent() in done() -> should be optimized
In lieu of a formal styleguide, take care to maintain the existing coding style.
Feel free to fork this project and make improvements. When you've finished, create a pull request for the changes you've made.