diff --git a/backend/Makefile b/backend/Makefile index b1de4d8b8..6366f2f05 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,6 +1,8 @@ include ../setup-env.mk -COMMIT ?= $(shell git rev-parse --short=7 HEAD) +ifndef COMMIT +COMMIT := $(shell git rev-parse --short=7 HEAD) +endif ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io ARO_HCP_BACKEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpbackend:$(COMMIT) diff --git a/backend/pipeline.yaml b/backend/pipeline.yaml index 68ca02805..ae9b4537f 100644 --- a/backend/pipeline.yaml +++ b/backend/pipeline.yaml @@ -20,3 +20,5 @@ resourceGroups: configRef: aksName - name: DB_NAME configRef: frontend.cosmosDB.name + - name: COMMIT + configRef: backend.imageTag diff --git a/config/config.msft.yaml b/config/config.msft.yaml index ed3bb89b2..846d6efb6 100644 --- a/config/config.msft.yaml +++ b/config/config.msft.yaml @@ -141,6 +141,10 @@ clouds: imageTag: 0b3c08f ocMirror: imageTag: 0b3c08f + frontend: + imageTag: 0b3c08f + backend: + imageTag: 0b3c08f environments: int: diff --git a/config/config.schema.json b/config/config.schema.json index 320b37062..4f014f5bb 100644 --- a/config/config.schema.json +++ b/config/config.schema.json @@ -100,9 +100,24 @@ "armHelperFPAPrincipalId": { "type": "string" }, + "backend": { + "type": "object", + "properties": { + "imageTag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "imageTag" + ] + }, "frontend": { "type": "object", "properties": { + "imageTag": { + "type": "string" + }, "cosmosDB": { "type": "object", "properties": { @@ -130,6 +145,7 @@ }, "additionalProperties": false, "required": [ + "imageTag", "cosmosDB" ] }, diff --git a/config/config.yaml b/config/config.yaml index b87e3ca7c..90b902d52 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -143,6 +143,12 @@ clouds: # Hypershift Operator hypershiftOperator: imageTag: 9aca808 + # Frontend + frontend: + imageTag: '' # if empty uses commit sha of repo + # Backend + backend: + imageTag: '' # if empty uses commit sha of repo # Shared SVC KV serviceKeyVault: name: 'aro-hcp-dev-svc-kv' diff --git a/config/public-cloud-cs-pr.json b/config/public-cloud-cs-pr.json index 66c3860a6..1f268e79e 100644 --- a/config/public-cloud-cs-pr.json +++ b/config/public-cloud-cs-pr.json @@ -3,6 +3,9 @@ "armHelperClientId": "2c6ca254-36bd-43c8-a7a8-fe880bc2c489", "armHelperFPAPrincipalId": "bc17c825-6cf8-40d0-8bd6-5536a993115e", "aroDevopsMsiId": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/global/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-hcp-devops", + "backend": { + "imageTag": "" + }, "baseDnsZoneName": "hcp.osadev.cloud", "baseDnsZoneRG": "global", "clusterService": { @@ -29,7 +32,8 @@ "disableLocalAuth": true, "name": "arohcp-rp-cspr", "private": false - } + }, + "imageTag": "" }, "global": { "manageTokenCustomRole": true, diff --git a/config/public-cloud-dev.json b/config/public-cloud-dev.json index a2fd1b8c7..d60187954 100644 --- a/config/public-cloud-dev.json +++ b/config/public-cloud-dev.json @@ -3,6 +3,9 @@ "armHelperClientId": "2c6ca254-36bd-43c8-a7a8-fe880bc2c489", "armHelperFPAPrincipalId": "bc17c825-6cf8-40d0-8bd6-5536a993115e", "aroDevopsMsiId": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/global/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-hcp-devops", + "backend": { + "imageTag": "" + }, "baseDnsZoneName": "hcp.osadev.cloud", "baseDnsZoneRG": "global", "clusterService": { @@ -29,7 +32,8 @@ "disableLocalAuth": true, "name": "arohcp-rp-dev", "private": false - } + }, + "imageTag": "" }, "global": { "manageTokenCustomRole": true, diff --git a/config/public-cloud-msft-int.json b/config/public-cloud-msft-int.json index 8527659be..c93b091f2 100644 --- a/config/public-cloud-msft-int.json +++ b/config/public-cloud-msft-int.json @@ -3,6 +3,9 @@ "armHelperClientId": "", "armHelperFPAPrincipalId": "", "aroDevopsMsiId": "/subscriptions/5299e6b7-b23b-46c8-8277-dc1147807117/resourcegroups/global-shared-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aroint-int-public-oidc", + "backend": { + "imageTag": "0b3c08f" + }, "baseDnsZoneName": "aroapp-hcp.azure-test.net", "baseDnsZoneRG": "global-shared-resources", "clusterService": { @@ -29,7 +32,8 @@ "disableLocalAuth": true, "name": "arohcp-rp-int", "private": false - } + }, + "imageTag": "0b3c08f" }, "global": { "manageTokenCustomRole": false, diff --git a/config/public-cloud-personal-dev.json b/config/public-cloud-personal-dev.json index b1155a770..52457158f 100644 --- a/config/public-cloud-personal-dev.json +++ b/config/public-cloud-personal-dev.json @@ -3,6 +3,9 @@ "armHelperClientId": "2c6ca254-36bd-43c8-a7a8-fe880bc2c489", "armHelperFPAPrincipalId": "bc17c825-6cf8-40d0-8bd6-5536a993115e", "aroDevopsMsiId": "/subscriptions/1d3378d3-5a3f-4712-85a1-2485495dfc4b/resourceGroups/global/providers/Microsoft.ManagedIdentity/userAssignedIdentities/aro-hcp-devops", + "backend": { + "imageTag": "" + }, "baseDnsZoneName": "hcp.osadev.cloud", "baseDnsZoneRG": "global", "clusterService": { @@ -29,7 +32,8 @@ "disableLocalAuth": true, "name": "arohcp-rp-usw3tst", "private": false - } + }, + "imageTag": "" }, "global": { "manageTokenCustomRole": true, diff --git a/frontend/Makefile b/frontend/Makefile index 99b2fa958..f865f4c18 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,6 +1,8 @@ include ../setup-env.mk -COMMIT ?= $(shell git rev-parse --short=7 HEAD) +ifndef COMMIT +COMMIT := $(shell git rev-parse --short=7 HEAD) +endif ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpfrontend:$(COMMIT) diff --git a/frontend/pipeline.yaml b/frontend/pipeline.yaml index 85516de2a..9a90851e2 100644 --- a/frontend/pipeline.yaml +++ b/frontend/pipeline.yaml @@ -24,3 +24,5 @@ resourceGroups: configRef: aksName - name: DB_NAME configRef: frontend.cosmosDB.name + - name: COMMIT + configRef: frontend.imageTag