Skip to content

feat: change build name for variable only deployments#4027

Merged
CGoodwin90 merged 4 commits intomainfrom
variable-only-deployment
Dec 9, 2025
Merged

feat: change build name for variable only deployments#4027
CGoodwin90 merged 4 commits intomainfrom
variable-only-deployment

Conversation

@shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Nov 18, 2025

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

Description

Extends deployment type with a new field buildType that is an enum, the default is BUILD, but also supports VARIABLES. This will change depending on if the build has been flagged to be a variables only deployment. The existence of the variables only deployment flag also changes the name of the build to be lagoon-variables-xyz instead of lagoon-build-xyz to also differentiate in the list of deployments. The CONTAINER_REGISTRY scope should be treated the same as BUILD, as it is only consumed during a build.

Usage

An example of triggering a variables only deployment. This sets the build variable LAGOON_VARIABLES_ONLY to true.

mutation deployEnvironmentLatest{
	deployEnvironmentLatest(input:{
  	environment:{
    	id: 3
      project: {
      	id: 18
      }
    }
    buildVariables: [
    	{name: "LAGOON_VARIABLES_ONLY", value: "true"}
    ]
    returnData: true
  })
}

Limitations

Variables only deployments have some limitations. Only RUNTIME and GLOBAL scope are considered as being changed (GLOBAL because it is considered RUNTIME and BUILD). However, if the variable being changed is GLOBAL or BUILD and is required to influence the outcome of built images, or change behaviour of something during a build, then a full deployment would be required. In the event that a GLOBAL scope is changed, only the runtime version of that variable will be updated in the environment.

Requirements

This shouldn't be merged until uselagoon/build-deploy-tool#430 has been evaluated. The two are sort of linked together, merging this without the other just seems silly.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Overview

Image reference testlagoon/api:main lagoon/api:ci-latest
- digest 6188b3a5cc2f 04a41a436f49
- tag main ci-latest
- provenance https://github.com/uselagoon/lagoon.git/commit/acf175fb0feaa0104c8ccda90143bf220b7ff97b
- vulnerabilities critical: 0 high: 7 medium: 11 low: 2 unspecified: 1 critical: 0 high: 7 medium: 11 low: 2 unspecified: 1
- platform linux/amd64 linux/amd64
- size 149 MB 179 MB (+31 MB)
- packages 1522 1522
Base Image node:22-alpine
also known as:
22-alpine3.22
22.21-alpine
22.21-alpine3.22
22.21.1-alpine
22.21.1-alpine3.22
jod-alpine
jod-alpine3.22
node:22-alpine
also known as:
22-alpine3.22
22.21-alpine
22.21-alpine3.22
22.21.1-alpine
22.21.1-alpine3.22
jod-alpine
jod-alpine3.22
- vulnerabilities critical: 0 high: 1 medium: 0 low: 2 critical: 0 high: 1 medium: 0 low: 2

@shreddedbacon shreddedbacon force-pushed the variable-only-deployment branch from f96f7d9 to c04d6e3 Compare December 1, 2025 22:08
@shreddedbacon shreddedbacon marked this pull request as ready for review December 1, 2025 23:43
Copy link
Contributor

@bomoko bomoko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I just wonder about the name of the function generating the build id

@shreddedbacon shreddedbacon force-pushed the variable-only-deployment branch from c04d6e3 to 71ef6f9 Compare December 4, 2025 20:55
@bomoko
Copy link
Contributor

bomoko commented Dec 7, 2025

@shreddedbacon - is this good to look at again?

@shreddedbacon
Copy link
Member Author

Yep, just as long as the merge requirements are not ignored, the other PR still needs review.

@shreddedbacon shreddedbacon requested a review from bomoko December 7, 2025 20:39
@CGoodwin90 CGoodwin90 merged commit fdb793f into main Dec 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants