Skip to content

Commit 05e203d

Browse files
committed
Refactored HS Account id
1 parent 745790f commit 05e203d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Jenkinsfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ pipeline {
6363
AWS_SECRET_ACCESS_KEY = credentials('aws-secret-key')
6464
AWS_DEFAULT_REGION = 'eu-west-2'
6565
ROLE_ARN = credentials('home-server-role-arn')
66+
HS_ACCOUNT_ID = credentials('home-server-aws-account-id')
6667
}
6768
steps {
6869
script {
6970
sh '''
7071
./build/aws/assume-role.sh;
71-
aws ecr get-login-password | docker login -u AWS --password-stdin "https://$(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.eu-west-2.amazonaws.com"
72-
docker tag cjww-development/gatekeeper:${TAG_NAME} $(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.eu-west-2.amazonaws.com/gatekeeper:${TAG_NAME}
73-
docker push $(aws sts get-caller-identity --query 'Account' --output text).dkr.ecr.eu-west-2.amazonaws.com/gatekeeper:${TAG_NAME}
72+
aws ecr get-login-password | docker login -u AWS --password-stdin "https://${HS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
73+
docker tag cjww-development/gatekeeper:${TAG_NAME} ${HS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/gatekeeper:${TAG_NAME}
74+
docker push ${HS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/gatekeeper:${TAG_NAME}
7475
'''
7576
}
7677
}

0 commit comments

Comments
 (0)