@@ -10,38 +10,6 @@ AWS_DEFAULT_REGION=eu-west-2
1010IMAGE_REPO_NAME=deductions/mesh-forwarder
1111export NHS_SERVICE=mesh-forwarder
1212
13- AWS_HELPERS_VERSION=0.2.27
14- echo " AWS helper scripts version: $AWS_HELPERS_VERSION "
15-
16-
17- # ##########################
18- # Shared utils #
19- # ##########################
20-
21- function download_util() {
22- local UTIL_VERSION=$1
23- local UTIL_FILENAME=$2
24-
25- local UTIL_FILEPATH=" utils/$UTIL_VERSION /$UTIL_FILENAME "
26-
27- mkdir -p " utils/$UTIL_VERSION "
28- if [[ ! -f $UTIL_FILEPATH ]]; then
29- wget --quiet -O $UTIL_FILEPATH https://github.com/nhsconnect/prm-deductions-support-infra/releases/download/${UTIL_VERSION} /${UTIL_FILENAME}
30- fi
31- chmod +x $UTIL_FILEPATH
32-
33- echo " $UTIL_FILEPATH "
34- }
35-
36- function fetch_redaction_utils() {
37- download_util $AWS_HELPERS_VERSION run-with-redaction.sh
38- download_util $AWS_HELPERS_VERSION redactor
39- }
40-
41- AWS_HELPERS_FILE=$( download_util $AWS_HELPERS_VERSION aws-helpers)
42- source $AWS_HELPERS_FILE
43-
44-
4513# ###################################
4614# Instance (Environment) Variables #
4715# ###################################
@@ -137,14 +105,9 @@ function set_cert_issuer() {
137105}
138106
139107function setup_venv {
140- venv_directory=venv
141- echo " Using this directory for venv: ${venv_directory} "
142- python3 -m venv " ${venv_directory} "
143- source " ${venv_directory} " /bin/activate
144- }
145-
146- function get_aws_account_id() {
147- AWS_ACCOUNT_ID=$( aws sts get-caller-identity | jq -r .Account)
108+ echo " Creating Dev Virtual Environment"
109+ pip3 install pipenv
110+ pipenv shell
148111}
149112
150113function generate_mesh_fqdn() {
@@ -159,19 +122,6 @@ function generate_mesh_fqdn() {
159122 fi
160123}
161124
162- function build_forwarder_image() {
163- fetch_redaction_utils
164- docker build --build-arg SOURCE_IMAGE_TAG=$SOURCE_IMAGE_TAG \
165- --build-arg UTILS_VERSION=$AWS_HELPERS_VERSION \
166- -t " $IMAGE_REPO_NAME :${IMAGE_TAG} " .
167- }
168-
169- function push_forwarder_image_to_repo_ecr() {
170- IMAGE_FULL_URL=" ${REPOSITORY_URI} :${IMAGE_TAG} "
171- docker tag " $IMAGE_REPO_NAME :${IMAGE_TAG} " " $IMAGE_FULL_URL "
172- docker push " $IMAGE_FULL_URL "
173- }
174-
175125function generate_csr {
176126 keys_file_name=" $1 "
177127 # If you intend to secure the URL https://www.yourdomain.com, then your CSR’s common name must be www.yourdomain.com
@@ -300,11 +250,6 @@ case "${command}" in
300250 set_nems_env
301251 python3 print_delete_subscription.py
302252 ;;
303- promote_docker_image)
304- check_env
305- set_image_tag
306- promote_docker_image " $IMAGE_REPO_NAME :$IMAGE_TAG " " $NHS_ENVIRONMENT "
307- ;;
308253 venv)
309254 setup_venv
310255 ;;
@@ -316,13 +261,6 @@ case "${command}" in
316261 --cluster $NHS_ENVIRONMENT -${NHS_SERVICE} -ecs-cluster \
317262 --services $NHS_ENVIRONMENT -mesh-forwarder-service
318263 ;;
319- fetch_utils)
320- fetch_redaction_utils
321- ;;
322- build_docker)
323- set_image_tag
324- build_forwarder_image
325- ;;
326264 push_forwarder_image_to_repo_ecr)
327265 if [ -z $SOURCE_IMAGE_TAG ]; then
328266 echo " Please set SOURCE_IMAGE_TAG environment variable"
0 commit comments