Comments (10)
Good point.
In ServiceNow its by design that, during a deployment, some actions might need to be done manually, but manual actions actually are not what we want in a CICD pipeline :-/
So all deployment related objects must be part of the updateset.
The 'Create Application File from Record' OOB feature can help to attach such records to an updateset. It actually creates an XML dump of the record into a sys_metadata_link record.
Alternatively the below script can be used to manually add any kind of files to an update-set.
function addToUpdateSet(usSysId, className, sysId) {
// check if us exists
var us = new GlideRecord('sys_update_set');
if (us.get(usSysId)) {
// 'Make This My Current Set'
new GlideUpdateSet().set(usSysId);
} else {
throw Error('Updateset not found' + usSysId);
}
var gr = new GlideRecord(className);
if (gr.get(sysId)) {
// add record to update-set
new GlideUpdateManager2().saveRecord(gr);
gs.info("done");
} else {
gs.info("record not found: " + className + ':' + sysId);
}
}
There is also the option to create an UI action with the above script to allwo to collect records to US from the UI.
If a deployment requires some script to be executed post go-live, there is also an option to create a scheduler (sysauto_script) with all scripts. After a successful run, the scheduler can disabling (or even delete) itself.
from sn-cicd.
Thanks @bmoers , will try it. close it now.
from sn-cicd.
Update set with 'group' data records committed successfully, but the data record can't be see from system groups:
Source and Target servers:
two free instances ServiceNow (glide-london-06-27-2018__patch1-08-15-2018_08-22-2018_1559)
Steps to produce:
-
Add UI Action into source instance
https://community.servicenow.com/sys_attachment.do?sys_id=708c1882dbdc17041dcaf3231f9619de -
Create a new group record "mytest"
-
Click 'Force to updateset' button, the record will insert into current Updateset
-
Use SN-CICD to deploy this updateset
-
Check on target server, the updateset is
committed
, the updateset having thexml
piece of group record "mytest" -
Check 'System security - Groups' on target server, no any new records created
Any thing wrong with the target server committed the updateset ?
from sn-cicd.
More tests: using the same updateset generated from above steps
On target server:
- use SNOW 'retrieve updateset' button, find the updateset and then click 'commit update set' button
- updateset will be 'committed', and 'System security - Groups' on target server, having the right records created
Any difference between SN-CICD commit
vs. SNOW commit update set
button?
from sn-cicd.
sn-cicd-integration:
Turn out this code working:
var commitResult = new UpdateSetCommitAjax((function () {
var params = {
sysparm_type: 'commitRemoteUpdateSet',
sysparm_remote_updateset_sys_id: payload.remoteUpdateSetSysId
};
return {
getParameter: function (paramName) {
return params[paramName];
}
};
})(), new GlideXMLDocument(), '').process();
var progress_id = commitResult.split(',')[0];
The following one can't handle the data record of the update set
var worker = new SNC.HierarchyUpdateSetScriptable();
var progress_id = worker.commitHierarchy(payload.remoteUpdateSetSysId);
@bmoers , Can you please confirm my finding?
from sn-cicd.
Seems the HierarchyUpdateSetCommitAjax does not work for forced records.
@gitlabbin can you check if forced records in hierarchical update-sets get installed (with 'new SNC.HierarchyUpdateSetScriptable()' ..)
The 'commitRemoteUpdateSet' only works for non-hierarchical update-sets. So it requires a check first to run either or.
Let me check.
from sn-cicd.
I was not able to reproduce the issue.
@gitlabbin can you please share the update-set you tested?
Attached the one I have used.
Test - No Parent- sys_remote_update_set_459ab967db42230051cefbef29961993.zip
from sn-cicd.
The simple updateset just with a group
record:
please look at here https://gist.github.com/gitlabbin/0409792d54f921700688154532ffa9a5
from sn-cicd.
Deployed a fix in bmoers/sn-cicd-integration@7d3d70c
Please take latest update-set from here https://github.com/bmoers/sn-cicd-integration/blob/master/update_set/CICD%20Integration.xml
from sn-cicd.
Great, close this. 👍
from sn-cicd.
Related Issues (20)
- Incorrect baselineCommitId for merged-deployment after a fix-deployment
- Error when click in "Build this Application" HOT 2
- git setup fails if application name contains special character
- Error while building the application HOT 5
- Build UI action not being displayed in New York release ?
- build fails on update set action = delete HOT 1
- 1.4 - deployment of app with multiple scopes
- email notification in case slack is not available in the environment HOT 2
- Wrong scope of US during deployment
- Issue When Building App - Install Node App fails HOT 13
- Suport custom domains HOT 2
- Pull Request Slack Message
- ATF Cases Not executing HOT 1
- Deployment to target breaks with - Remote update-set not found HOT 6
- Orlando Deployment - Deployment phase fails at preview with 'Could not find a record in sys_app_category for column category referenced in this update' HOT 8
- exportFilesFromMaster : socket hang up
- pull request conflicts if the application of an update set is changed
- "Global" Update Set Name instead of App Name
- Error During Project Setup HOT 5
- Test connection in CICD Integration properties
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sn-cicd.