{"id":27952,"date":"2023-09-21T17:11:59","date_gmt":"2023-09-21T15:11:59","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=27952"},"modified":"2023-09-22T16:18:35","modified_gmt":"2023-09-22T14:18:35","slug":"declaring-environments-in-gitlab","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/","title":{"rendered":"Declaring environments in GitLab"},"content":{"rendered":"\n<p>Why do I need to declare environments in GitLab ?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To track deployed versions on each environment<\/li>\n\n\n\n<li>To control deployment on environments (e.g. add an approval to deploy production)<\/li>\n\n\n\n<li>Add environment-related variables<\/li>\n<\/ul>\n\n\n\n<p>An environment can be linked to a pipeline step. For example, to define the target of a deployment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-create-an-environment\"><strong>Create an environment<\/strong><\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-1-in-the-side-menu-go-to-operate-gt-environments\">1. In the side menu, go to : Operate &gt; Environments<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"319\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png\" alt=\"\" class=\"wp-image-27953\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-300x93.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-768x239.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1536x478.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-2048x638.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-2-click-on-new-environment-set-the-parameters\">2. Click on &#8220;New environment&#8221;, set the parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name: with the name of your environment<\/li>\n\n\n\n<li>External URL: the URL of your environment (use in environments list for the Open button)<\/li>\n\n\n\n<li>GitLab agent: An option to define the agent to be used for environment deployment. Can remain blank<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"353\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-1024x353.png\" alt=\"\" class=\"wp-image-27954\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-1024x353.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-300x103.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-768x265.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-1536x529.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/New-Environment-Parameters-2048x705.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-3-environment-list\">3. Environment List<\/h4>\n\n\n\n<p>You can define several environments for a single project. They will then be available in the environment list in: Operate &gt; Environments<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"203\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-1024x203.png\" alt=\"\" class=\"wp-image-27958\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-1024x203.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-300x59.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-768x152.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-1536x304.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environments-List-2048x406.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-view-deployments\">View Deployments<\/h2>\n\n\n\n<p>When an environment has been specified in a deployment step, it is then possible to find out which version is deployed in the environment.<\/p>\n\n\n\n<p>Click on the arrow at the beginning of the line to expand the details panel :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"311\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-1024x311.png\" alt=\"\" class=\"wp-image-27959\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-1024x311.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-300x91.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-768x233.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-1536x467.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Deploy-Tracking-2048x622.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-define-ci-cd-variables-for-an-environment\">Define CI\/CD variables for an environment<\/h2>\n\n\n\n<p>It is possible to define environment-specific variables to use in pipelines.<\/p>\n\n\n\n<p>In your project, in the side menu, go to Settings &gt; CI\/CD, after that, expand the Variables section :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"407\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-1024x407.png\" alt=\"\" class=\"wp-image-27961\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-1024x407.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-300x119.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-768x305.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-1536x610.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-List-2048x814.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To add a variable, click on &#8220;Add variable&#8221; button and set the parameters :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Key: the name of your variable<\/li>\n\n\n\n<li>Value: the value of the variable<\/li>\n\n\n\n<li>Environment scope: defines the environment in which the variable will be available<\/li>\n<\/ul>\n\n\n\n<p><strong>Note :<\/strong> The same variable (with the same name) can de define for each environment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details-1024x765.png\" alt=\"\" class=\"wp-image-27962\" style=\"width:599px;height:448px\" width=\"599\" height=\"448\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details-1024x765.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details-300x224.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details-768x574.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details-1536x1148.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Variable-Details.png 1568w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p>In the .gitlab-ci.yml, environment scoped variables can be used similarly like a standard variable. ( For example: ${K8S_NS} )<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-protected-environments\">Protected environments<\/h2>\n\n\n\n<p>Protected environments can be used to prevent unintentional deployment or to authorize only certain users to deploy.<\/p>\n\n\n\n<p>In the side menu, go to Settings &gt; CI\/CD and expand the Protected environments section :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-1024x306.png\" alt=\"\" class=\"wp-image-27963\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-1024x306.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-300x90.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-768x229.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-1536x458.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Protected_Environments-2048x611.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-protect-an-environment\">Protect an environment :<\/h3>\n\n\n\n<p>Click on &#8220;Protect an environment&#8221;, select the environment to protect and set the parameters to define who can deploy and who can approve :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-1024x512.png\" alt=\"\" class=\"wp-image-27964\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-1024x512.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-300x150.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-768x384.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-1536x767.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add_Protected_Environments-2048x1023.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-deploy-on-protected-environment\">Deploy on protected Environment<\/h3>\n\n\n\n<p>When a pipeline reaches the step to deploy on a protected environment, the pipeline will wait for deployment approval<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"205\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-1024x205.png\" alt=\"\" class=\"wp-image-27965\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-1024x205.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-300x60.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-768x154.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-1536x308.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Pipeline-Wait-2048x411.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>At the same time, the environment deployment wait for approval in the environments list :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"339\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-1024x339.png\" alt=\"\" class=\"wp-image-27981\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-1024x339.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-300x99.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-768x254.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-1536x509.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Environment-deployment-wait-1-2048x678.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click on &#8220;Approval options&#8221; button and approve or reject the deployment :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options-1024x667.png\" alt=\"\" class=\"wp-image-27967\" style=\"width:672px;height:438px\" width=\"672\" height=\"438\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options-1024x667.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options-300x195.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options-768x500.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options-1536x1001.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Approval-options.png 1596w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/figure>\n\n\n\n<p>After approval, the pipeline does not restart automatically. Click on &#8220;Run&#8221; button to continue the deployment:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"224\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-1024x224.png\" alt=\"\" class=\"wp-image-27980\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-1024x224.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-300x66.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-768x168.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-1536x336.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Run-Pipeline-1-2048x447.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>Environments are very useful in GitLab. However, it&#8217;s possible to write pipelines without it. But if you don&#8217;t use environments for deployment, you&#8217;ll miss out on some really useful features, such as approvals, variables and, by the way, it becomes harder to track deployments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why do I need to declare environments in GitLab ? An environment can be linked to a pipeline step. For example, to define the target of a deployment. Create an environment 1. In the side menu, go to : Operate &gt; Environments 2. Click on &#8220;New environment&#8221;, set the parameters 3. Environment List You can [&hellip;]<\/p>\n","protected":false},"author":72,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1320],"tags":[2983,2667,2648,3028,2981],"type_dbi":[],"class_list":["post-27952","post","type-post","status-publish","format-standard","hentry","category-devops","tag-ci-cd","tag-devops-2","tag-gitlab","tag-gitlabci-cd","tag-pipeline"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Declaring environments in GitLab - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Declaring environments in GitLab\" \/>\n<meta property=\"og:description\" content=\"Why do I need to declare environments in GitLab ? An environment can be linked to a pipeline step. For example, to define the target of a deployment. Create an environment 1. In the side menu, go to : Operate &gt; Environments 2. Click on &#8220;New environment&#8221;, set the parameters 3. Environment List You can [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-21T15:11:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-22T14:18:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png\" \/>\n<meta name=\"author\" content=\"Nicolas Meunier\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nicolas Meunier\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/\"},\"author\":{\"name\":\"Nicolas Meunier\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/2e08c09a2f083004587b54128684fefe\"},\"headline\":\"Declaring environments in GitLab\",\"datePublished\":\"2023-09-21T15:11:59+00:00\",\"dateModified\":\"2023-09-22T14:18:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/\"},\"wordCount\":458,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/09\\\/Add-New-Environment-1024x319.png\",\"keywords\":[\"CI\\\/CD\",\"devops\",\"GitLab\",\"GitlabCI\\\/CD\",\"Pipeline\"],\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/\",\"name\":\"Declaring environments in GitLab - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/09\\\/Add-New-Environment-1024x319.png\",\"datePublished\":\"2023-09-21T15:11:59+00:00\",\"dateModified\":\"2023-09-22T14:18:35+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/2e08c09a2f083004587b54128684fefe\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/09\\\/Add-New-Environment-1024x319.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/09\\\/Add-New-Environment-1024x319.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/declaring-environments-in-gitlab\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Declaring environments in GitLab\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/2e08c09a2f083004587b54128684fefe\",\"name\":\"Nicolas Meunier\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g\",\"caption\":\"Nicolas Meunier\"},\"description\":\"Nicolas Meunier has more than 20 years of experience in IT web technologies as well as in development. He is specialized in Cloud solutions such as CI\\\/CD. His expertise also includes Kubernetes, Docker, Jenkins-X and Azure Devops. Florence Porret (FP is IT Consultant in Cloud solutions. Prior to joining dbi services, Nicolas Meunier was developer and maintainer of a CI\\\/CD pipelines at CEGID in Paris. He also worked as Lead Developer at KPMG. Florence Porret (FP holds a superior technical diploma in IT development. His branch-related experience covers software and cloud platform architecture.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/nicolasmeunier\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Declaring environments in GitLab - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/","og_locale":"en_US","og_type":"article","og_title":"Declaring environments in GitLab","og_description":"Why do I need to declare environments in GitLab ? An environment can be linked to a pipeline step. For example, to define the target of a deployment. Create an environment 1. In the side menu, go to : Operate &gt; Environments 2. Click on &#8220;New environment&#8221;, set the parameters 3. Environment List You can [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/","og_site_name":"dbi Blog","article_published_time":"2023-09-21T15:11:59+00:00","article_modified_time":"2023-09-22T14:18:35+00:00","og_image":[{"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png","type":"","width":"","height":""}],"author":"Nicolas Meunier","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nicolas Meunier","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/"},"author":{"name":"Nicolas Meunier","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2e08c09a2f083004587b54128684fefe"},"headline":"Declaring environments in GitLab","datePublished":"2023-09-21T15:11:59+00:00","dateModified":"2023-09-22T14:18:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/"},"wordCount":458,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png","keywords":["CI\/CD","devops","GitLab","GitlabCI\/CD","Pipeline"],"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/","url":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/","name":"Declaring environments in GitLab - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png","datePublished":"2023-09-21T15:11:59+00:00","dateModified":"2023-09-22T14:18:35+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2e08c09a2f083004587b54128684fefe"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2023\/09\/Add-New-Environment-1024x319.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/declaring-environments-in-gitlab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Declaring environments in GitLab"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/2e08c09a2f083004587b54128684fefe","name":"Nicolas Meunier","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc2139acc6c64bddf3827e2faaaa70f227faafc288457fc351a4a836813112a8?s=96&d=mm&r=g","caption":"Nicolas Meunier"},"description":"Nicolas Meunier has more than 20 years of experience in IT web technologies as well as in development. He is specialized in Cloud solutions such as CI\/CD. His expertise also includes Kubernetes, Docker, Jenkins-X and Azure Devops. Florence Porret (FP is IT Consultant in Cloud solutions. Prior to joining dbi services, Nicolas Meunier was developer and maintainer of a CI\/CD pipelines at CEGID in Paris. He also worked as Lead Developer at KPMG. Florence Porret (FP holds a superior technical diploma in IT development. His branch-related experience covers software and cloud platform architecture.","url":"https:\/\/www.dbi-services.com\/blog\/author\/nicolasmeunier\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=27952"}],"version-history":[{"count":20,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27952\/revisions"}],"predecessor-version":[{"id":28042,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/27952\/revisions\/28042"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=27952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=27952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=27952"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=27952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}