diff --git a/backend/Makefile b/backend/Makefile index b1de4d8b8..ce689a792 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,6 +1,8 @@ -include ../setup-env.mk +-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 760514b28..8cf79ad8a 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 2ece5c409..f2e6b4a85 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": { @@ -142,6 +157,7 @@ }, "additionalProperties": false, "required": [ + "imageTag", "cosmosDB", "cert" ] diff --git a/config/config.yaml b/config/config.yaml index bc1f5e7d2..b863b5298 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -145,6 +145,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 ecf92a670..7d14330d3 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": { @@ -32,7 +35,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 3f0c490c7..bb2b88a04 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": { @@ -32,7 +35,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 94ec03e49..3f88ec0c5 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": { @@ -32,7 +35,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 8f7125ced..16690e8a8 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": { @@ -32,7 +35,8 @@ "disableLocalAuth": true, "name": "arohcp-rp-usw3tst", "private": false - } + }, + "imageTag": "" }, "global": { "manageTokenCustomRole": true, diff --git a/frontend/Makefile b/frontend/Makefile index 99b2fa958..6cc2528c4 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,6 +1,8 @@ -include ../setup-env.mk +-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) @@ -9,6 +11,10 @@ ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpfrontend:$(COMMIT) frontend: go build -o aro-hcp-frontend . +info: + @echo "ARO_HCP_FRONTEND_IMAGE: ${ARO_HCP_FRONTEND_IMAGE}" + @echo "COMMIT: ${COMMIT}" + run: ./aro-hcp-frontend --use-cache --location ${LOCATION} \ --clusters-service-url http://localhost:8000 \ 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