forked from performant-software/core-data-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·42 lines (36 loc) · 1.7 KB
/
build.sh
File metadata and controls
executable file
·42 lines (36 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -e
echo "Building image"
docker build \
--file Dockerfile-ecds \
--build-arg AUTHENTICATION_EXPIRATION=$AUTHENTICATION_EXPIRATION \
--build-arg DATABASE_HOST=$DATABASE_HOST \
--build-arg DATABASE_NAME=$DATABASE_NAME \
--build-arg DATABASE_PASSWORD=$DATABASE_PASSWORD \
--build-arg DATABASE_PORT=5432 \
--build-arg DATABASE_USERNAME=$DATABASE_USERNAME \
--build-arg HOSTNAME=$HOSTNAME \
--build-arg IIIF_CLOUD_API_KEY=$IIIF_CLOUD_API_KEY \
--build-arg IIIF_CLOUD_PROJECT_ID=$IIIF_CLOUD_PROJECT_ID \
--build-arg IIIF_CLOUD_URL=$IIIF_CLOUD_URL \
--build-arg REACT_APP_IIIF_MANIFEST_ITEM_LIMIT=$REACT_APP_IIIF_MANIFEST_ITEM_LIMIT \
--build-arg REACT_APP_MAP_TILER_KEY=$REACT_APP_MAP_TILER_KEY \
--build-arg SECRET_KEY_BASE=$SECRET_KEY_BASE \
--build-arg ELASTICSEARCH_HOST=$ELASTICSEARCH_HOST \
--build-arg ELASTICSEARCH_API_KEY=$ELASTICSEARCH_API_KEY \
--build-arg GEONAMES_USER=$GEONAMES_USER \
--build-arg AWS_REGION=$AWS_REGION \
--build-arg CD_AWS_ACCESS_KEY_ID=$CD_AWS_ACCESS_KEY_ID \
--build-arg CD_AWS_SECRET_ACCESS_KEY=$CD_AWS_SECRET_ACCESS_KEY \
-t core-data-cloud \
.
echo "Logging in to AWS"
aws ecr get-login-password --region us-east-1 |
docker login --username AWS --password-stdin "${AWS_ECR}"
echo "Logged in successfully"
echo "Tagging image with latest"
docker tag core-data-cloud "${AWS_ECR}/core-data-cloud:latest"
echo "Pushing image"
docker push "${AWS_ECR}/core-data-cloud:latest"
# echo "Force update service"
aws ecs update-service --cluster ${AWS_ECS_CLUSTER} --service ${AWS_ECS_SERVICE} --force-new-deployment --region ${AWS_REGION}