{"id":36748,"date":"2023-07-13T22:46:41","date_gmt":"2023-07-13T22:46:41","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=36748"},"modified":"2023-07-14T05:35:45","modified_gmt":"2023-07-14T05:35:45","slug":"kapitan-commands-line-reference","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/kapitan-commands-line-reference\/","title":{"rendered":"Kapitan Commands line Reference"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Merges inventory and inputs and produces generated files in the output folder (\/compiled by default)<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Compiles one or more targets selected by name using &#8211;targets or -t<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile -t mysql tesoro<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Compiles one or more targets selected matching labels with &#8211;labels or -l<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile -l customer=acme<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Use the &#8211;fetch flag to fetch Remote Inventories and the External Dependencies.<\/h3>\n\n\n\n<p>This will download the dependencies according to their configurations By default, kapitan does not overwrite an existing item with the same name as that of the fetched inventory items.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile --fetch<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Use the &#8211;force-fetch flag to force fetch<\/h3>\n\n\n\n<p>to force fetch (update cache with freshly fetched items) and overwrite inventory items of the same name in the output_path.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile --force-fetch<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Use the &#8211;cache flag to cache the fetched items in the .dependency_cache directory in the root project directory.<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile --cache --fetch<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">The &#8211;embed-refs flags tells Kapitan to embed these references on compile,<\/h3>\n\n\n\n<p>alongside the generated output. By doing so, compiled output is self-contained and can be revealed by Tesoro or other tools.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile --embed-refs<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">kapitan compile &#8211;help<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan compile --help<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Renders the resulting inventory values for a specific target. For example, rendering the inventory for the mysql target:<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan inventory\n$ kapitan inventory -t mysql<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Perform a checkup on your inventory or refs.<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ .\/kapitan lint<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Shows all inventory files where a variable is declared:<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ .\/kapitan searchvar parameters.components.*.image<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Validates the schema of compiled output<\/h3>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ kapitan validate\n$ kapitan compile --validate<\/code><\/span><\/pre>","protected":false},"excerpt":{"rendered":"<p>Merges inventory and inputs and produces generated files in the output folder (\/compiled by default) Compiles one or more targets selected by name using &#8211;targets or -t Compiles one or more targets selected matching labels with &#8211;labels or -l Use the &#8211;fetch flag to fetch Remote Inventories and the External Dependencies. This will download the&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-36748","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/36748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=36748"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/36748\/revisions"}],"predecessor-version":[{"id":36753,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/36748\/revisions\/36753"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=36748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=36748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=36748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}