Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
GitLab FOSS
GitLab FOSS
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Packages
    • Packages
    • Container Registry
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #38549

You need to sign in or sign up before continuing.
Closed
Open
Opened Sep 28, 2017 by Mark Pundsack@markpundsack
  • Report abuse
  • New issue
Report abuse New issue

Use variables to define deploy policy for staging and production environments

Note: This issue requires https://gitlab.com/gitlab-org/gitlab-ce/issues/37397.

Owners

BE: @mayra-cabrera

Description

The current behavior of Auto DevOps is to use Continuous Deployment, pushing to production automatically every time a new pipeline is run on master.

There are cases where people want to use a staging environment, and deploy to production manually.

This is actually possible, but requires a few manual steps:

  1. make Auto Devops an explicit .gitlab-ci.yml
  2. enable the staging job
  3. change the production job to be manual

We should make it driven by variables, so the only needed step will be:

  1. define a group/project variable to enable the staging flow

Proposal

Improve the Auto DevOps template in order to support staging for deployments.

Required changes to the staging job:

  1. always defined (no trailing . in the job name)
  2. enable only when $STAGING_ENABLED

Required changes to the production job:

  1. enable except when $STAGING_ENABLED

A new job production_manual must be created cloning the production job:

  1. enable only when $STAGING_ENABLED
  2. define when: manual

Merge Requests

  • GitLab Ci Yml: gitlab-ci-yml!160 (merged)
  • Documentation for CE: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18675
  • Documentation for EE (Port): https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5536
Edited May 01, 2018 by Mayra Cabrera

Related issues

  • Discussion
  • Designs
Assignee
Assign to
10.8
Milestone
10.8
Assign milestone
Time tracking
None
Due date
None
9
Labels
CI/CD [DEPRECATED] Deliverable application control panel auto devops devops devops::configure direction feature workflow::In review
Assign labels
  • View project labels
Reference: gitlab-org/gitlab-foss#38549