Skip to content

Commit 8b511e5

Browse files
Publish helm chart to OCI registry for PR patches
1 parent 4c753fc commit 8b511e5

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.evergreen.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,16 @@ tasks:
468468
- func: helm_registry_login
469469
- func: publish_helm_chart
470470

471+
- name: publish_helm_chart
472+
commands:
473+
- func: clone
474+
- func: setup_kubectl
475+
- func: setup_aws
476+
- func: prepare_aws
477+
- func: helm_registry_login
478+
- func: python_venv
479+
- func: publish_helm_chart
480+
471481
- name: prepare_aws
472482
priority: 59
473483
commands:

scripts/dev/helm_registry_login.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
ECR_REGISTRY="268558157000.dkr.ecr.us-east-1.amazonaws.com"
4+
AWS_REGION="us-east-1"
5+
6+
source scripts/dev/set_env_context.sh
7+
8+
export PATH=${PROJECT_DIR}/bin:$PATH
9+
10+
echo "Checking if helm CLI is installed..."
11+
if ! command -v helm &> /dev/null
12+
then
13+
echo "Error: helm CLI could not be found."
14+
echo "Please ensure helm is installed and in your system's PATH."
15+
exit 1
16+
fi
17+
18+
echo "Checking if aws CLI is installed..."
19+
if ! command -v aws &> /dev/null
20+
then
21+
echo "Error: aws CLI could not be found."
22+
echo "Please ensure aws CLI is installed and configured."
23+
exit 1
24+
fi
25+
26+
echo "Logging into OCI Registry: ${ECR_REGISTRY} in region ${AWS_REGION}..."
27+
28+
if aws ecr get-login-password --region "$AWS_REGION" | helm registry login \
29+
--username AWS \
30+
--password-stdin \
31+
"$ECR_REGISTRY"
32+
then
33+
echo "Helm successfully logged into the OCI registry."
34+
exit 0
35+
else
36+
echo "ERROR: Helm login to ECR registry failed."
37+
echo "Please ensure your AWS credentials have permission to access ECR in the specified region."
38+
exit 1
39+
fi

0 commit comments

Comments
 (0)