{"id":181,"date":"2019-11-01T12:52:15","date_gmt":"2019-11-01T12:52:15","guid":{"rendered":"https:\/\/sdf-docs.mansystems.com\/docs\/sdf-documentation\/ci-cd\/jobs\/"},"modified":"2022-05-17T09:24:38","modified_gmt":"2022-05-17T09:24:38","slug":"jobs","status":"publish","type":"docs","link":"https:\/\/sdf-docs.clevr.com\/?docs=ci-cd\/ci-cd\/jobs","title":{"rendered":"Jobs"},"content":{"rendered":"\n<p>The following jobs can be added in a pipeline:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"866\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-13.png\" alt=\"\" class=\"wp-image-2500\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-13.png 764w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-13-480x544.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 764px, 100vw\" \/><\/figure>\n\n\n\n<p>All jobs are simple and have few\nproperties.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a>Shared properties<\/a><\/h3>\n\n\n\n<p>All jobs have an auto-description and a stop on fail property. Stop on fail means the next action in the pipeline is not executed if the previous one fails. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"770\" height=\"773\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-14.png\" alt=\"\" class=\"wp-image-2502\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-14.png 770w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-14-480x482.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 770px, 100vw\" \/><\/figure>\n\n\n\n<p>Actually only actions with special execution settings are still executed:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"427\" height=\"237\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-16.png\" alt=\"\" class=\"wp-image-2504\" srcset=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-16.png 427w, https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-16-300x167.png 300w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"279\" src=\"https:\/\/sdf-docs.clevr.com\/wp-content\/uploads\/2022\/05\/image-15.png\" alt=\"\" class=\"wp-image-2503\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><a>Mendix cloud<\/a> job<\/h3>\n\n\n\n<p>A Mendix cloud job does all the deployment activities for the Mendix cloud. The following actions are possible:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td>\n  <strong>Job<\/strong>\n  <\/td><td>\n  <strong>Description<\/strong>\n  <\/td><\/tr><tr><td>\n  Build deployment package\n  <\/td><td>\n  To build a deployment package from the latest commit of a branch\n  Select branch\n  <\/td><\/tr><tr><td>\n  Clean\n  <\/td><td>\n  To clean the cloud slot (delete database, deployed package). Use with\n  care!\n  Select environment\n  <\/td><\/tr><tr><td>\n  Create backup\n  <\/td><td>\n  Creates a database backup for an environment\n  Select environment\n  <\/td><\/tr><tr><td>\n  Create savepoint\n  <\/td><td>\n  Create a savepoint (database backup, deployment package, settings\n  copy) for an environment\n  Select environment\n  <\/td><\/tr><tr><td>\n  Restore backup\n  <\/td><td>\n  Restores a backup to an environment\n  Select environmentSelect backup (after selecting environment!)\n  \n  Use case is to restore a specific backup for security or load tests\n  <\/td><\/tr><tr><td>\n  Restore savepoint\n  <\/td><td>\n  Restore the latest savepoint to an environment\n  Select environment\n  Use case is to restore a failed pipeline. You might want to check\n  what the latest savepoint is in case multiple attempts have been done to run\n  a pipeline\n  <\/td><\/tr><tr><td>\n  Set settings\n  <\/td><td>\n  Update the cloud slot settings (scheduled events, constants, runtime\n  settings) with a locally stored set.\n  Select environmentSelect locally saved and named settings (under app\n  settings, tab Mendix cloud)\n  \n  <\/td><\/tr><tr><td>\n  Start\n  <\/td><td>\n  Start environment\n  Select environment\n  <\/td><\/tr><tr><td>\n  Stop\n  <\/td><td>\n  Stop environment\n  Select environment\n  <\/td><\/tr><tr><td>\n  Synchronize\n  <\/td><td>\n  Sync environment status (running, deployed package), list of\n  deployment packages, list of backups, list of revisions.\n  This is often the first job in a pipeline for Mendix cloud jobs, so\n  CI\/CD knows what the latest commit is.\n  <\/td><\/tr><tr><td>\n  Transport deployment\n  <\/td><td>\n  To transport a deployment from one cloud environment to the next.\n  Select transport sourceLatest\n  deployment packageOther\n  environments deployment packageDeployment\n  package created by other job in this pipelineSelect from environment (After transport source\n  2.)Select job (After transport source 3.)Select to environment\n  \n  \n  \n  \n  \n  \n  <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>A savepoint stores a backup of the database,\nthe deployment package and all constants\/runtime settings\/scheduled event\nsettings. So a restore of a savepoint brings the environment in exactly the\nsituation as it was when the savepoint was created.<\/p>\n\n\n\n<p>For this reason the server is stopped\nfirst, so the backup is not taken with the application live.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a>APM<\/a> job<\/h3>\n\n\n\n<p>APM defines API keys per environment, so\nthe API account already exactly defines which agent\/environment\/runtime is\nperforming the job.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-fixed-layout\"><tbody><tr><td>\n  <strong>Job<\/strong>\n  <\/td><td>\n  <strong>Description<\/strong>\n  <\/td><\/tr><tr><td>\n  Snapshot reset\n  <\/td><td>\n  Clear statistics in APM agent\n  <\/td><\/tr><tr><td>\n  Snapshot create\n  <\/td><td>\n  Get manual statistics snapshot. Is used in code coverage.\n  <\/td><\/tr><tr><td>\n  Recording start\n  <\/td><td>\n  Start performance recording\n  <\/td><\/tr><tr><td>\n  Recording stop\n  <\/td><td>\n  Stop performance recording\n  <\/td><\/tr><tr><td>\n  Load test\n  <\/td><td>\n  Start a load test based on a named setup in APM Manager\/Load test\n  setup. This setup includes all information for the test (script, data,\n  environment, robots, duration, amounts)\n  Name load test\n  <\/td><\/tr><tr><td>\n  Unit test\n  <\/td><td>\n  Start unit tests <em>(on 1 runtime instance if multiple exist)<\/em>\n  <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>For a unit test to be triggered you need an\nAPM agent (and thus also an APM license) and an extra module APMAgent2UnitTest\nthat is needed besides the AppStore Unittest module.<\/p>\n\n\n\n<p>To run a load test you must prepare a\nscript and setup and also have a baseline defined. This, so the load test\nexecuted during the pipeline can compare performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a>Code coverage job<\/a><\/h3>\n\n\n\n<p>A typical code coverage job consists of the\nfollowing steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Reset counters<\/li><li>Run unit\/UI tests<\/li><li>Get APM snapshot with information on which microflows have run<\/li><li>Calculate code coverage in ACR and get number<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><a>CI\/CD job<\/a><\/h3>\n\n\n\n<p>To call a pipeline in another app. For example when implementing micro services, you can control the pipelines of multiple apps.<\/p>\n\n\n\n<p>Steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Create pipeline in other app<\/li><li>Create API key in other app<\/li><li>Use [Send to CI\/CD API\naccount]:<\/li><\/ol>\n\n\n\n<p>A dialog to select the other project is\nshown.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create CI\/CD job using:<ul><li>API Account from 3<\/li><\/ul><ul><li>Pipeline from select dialog<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>When calling our CI\/CD from an external app you can find the pipeline guid on the API tab on the pipeline.<\/p>\n","protected":false},"featured_media":0,"parent":11,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-181","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/181"}],"collection":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":3,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/181\/revisions"}],"predecessor-version":[{"id":2505,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/181\/revisions\/2505"}],"up":[{"embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/11"}],"next":[{"title":"New pipeline","link":"https:\/\/sdf-docs.clevr.com\/?docs=ci-cd\/ci-cd\/1-3-new-pipeline","href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=\/wp\/v2\/docs\/28"}],"wp:attachment":[{"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/sdf-docs.clevr.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}