@@ -13,19 +13,40 @@ export http_proxy=
1313export https_proxy =
1414export no_proxy = localhost
1515
16+ # AWS settings
17+ # # AWS_PROFILE - name of AWS settings profile AWS_PROFILE=default(default)|aws-do-eks|...
18+ export AWS_PROFILE = default
19+ # # AWS_REGION - will be set to AWS_DEFAULT_REGION if not set externally.
20+ export AWS_DEFAULT_REGION = us-east-1
21+ if [ "${AWS_REGION}" == "" ]; then
22+ export AWS_REGION = $AWS_DEFAULT_REGION
23+ fi
1624# Docker image settings
1725# # REGISTRY: [optional] - Docker registry path including trailing "/". Example: registry.company.com/demo/
18- export REGISTRY =
26+ # # If REGISTRY==default, then the default elastic container registry in the account for the current region will be used
27+ export REGISTRY = default
28+ # # Set default registry if needed
29+ if [ "$REGISTRY" == "default" ]; then
30+ export REGION = ${ AWS_REGION }
31+ export ACCOUNT = $( aws sts get-caller-identity --query Account --output text)
32+ if [ "$ACCOUNT" == "" ]; then
33+ export REGISTRY = " "
34+ else
35+ export REGISTRY = ${ ACCOUNT } .dkr.ecr.${ REGION } .amazonaws.com/
36+ fi
37+ fi
38+ # # Add trailing forward slash if needed
1939if [ -n "${REGISTRY}" ]; then
2040 if [ "${REGISTRY: -1}" != "/" ]; then
2141 export REGISTRY = " ${ REGISTRY } /"
2242 fi
2343fi
44+
2445# # IMAGE: <required> - Docker image name for this project. Example: myapp
2546export IMAGE = aws-do-eks
2647# # VERSION: [optional] - Version tag for this Docker image. Example: v20180302
2748# export VERSION=v$(date +%Y%m%d)
28- export VERSION = v3-20220707
49+ export VERSION = v4-20220801
2950export TAG = $( if [ -z " ${VERSION} " ]; then echo " " ; else echo " :${VERSION} " ; fi )
3051# # BUILD_OPTS: [optional] - arguments for the docker image build command
3152export BUILD_OPTS = " --progress plain --build-arg http_proxy=${ http_proxy } --build-arg https_proxy=${ https_proxy } --build-arg no_proxy=${ no_proxy } "
@@ -37,9 +58,9 @@ export CONTAINER_NAME="--name ${CONTAINER}"
3758# # Port map [optional] - Mapping of external to internal ports including the -p switch. Example -p 80:8080
3859# export PORT_MAP="-p 80:8080"
3960# # Volume map [optional] - Mapping of external to internal paths including the -v switch. Example $(pwd):/wd
40- export VOL_MAP = " -v ${ HOME } /.aws:/root/.aws -v ${ HOME } /.kube:/root/.kube -v $( pwd) /wd/conf/eks.conf:/eks/eks.conf -v $( pwd) /wd/conf/eks.yaml:/eks/eks.yaml -v $( pwd) :/aws-do-eks"
61+ export VOL_MAP = " -v ${ HOME } /.aws:/root/.aws -v ${ HOME } /.kube:/root/.kube -v $( pwd) /wd/conf/eks.conf:/eks/eks.conf -v $( pwd) /wd/conf/eks.yaml:/eks/eks.yaml -v $( pwd) :/aws-do-eks -v /var/run/docker.sock:/var/run/docker.sock "
4162# # Network [optional] - Network name including the --net switch. Example --net mynet
4263# export NETWORK=
4364# # RUN_OPTS [optional] - additional options to specify with the run comman. Example -e POSTGRES_DB=dbname
44- export RUN_OPTS = " -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy "
65+ export RUN_OPTS = " -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e no_proxy=$no_proxy -e AWS_PROFILE= $AWS_PROFILE -e REGION= $REGION "
4566
0 commit comments