Skip to content

Commit f42513e

Browse files
committed
Adding all the stuff back up.
1 parent f49ab89 commit f42513e

38 files changed

+4362
-4323
lines changed

build_deploy.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
3+
# Clear the stack:
4+
aws cloudformation delete-stack --stack-name neoapi-dev --region us-east-2 && aws cloudformation wait stack-delete-complete --stack-name neoapi-dev --region us-east-2
5+
6+
aws cloudformation delete-stack --stack-name neoapi-prod --region us-east-2 && aws cloudformation wait stack-delete-complete --stack-name neoapi-prod --region us-east-2
7+
8+
# set env vars
9+
AWS_REGION="us-east-2" # Change to your region
10+
AWS_ACCOUNT_ID="417278330808" # Change to your account ID
11+
REPOSITORY_NAME="neoapi-prod"
12+
IMAGE_TAG="latest"
13+
STACK_NAME="neoapi-prod"
14+
ENVIRONMENT="prod"
15+
IMAGE_URI="417278330808.dkr.ecr.us-east-2.amazonaws.com/neoapi-prod:latest"
16+
VPC_ID="vpc-0d10dcdc60306b07e"
17+
PRIVATE_SUBNETS="subnet-0e66614ca7e9e7247,subnet-013f8ff069404c987"
18+
NODE_ENV=development
19+
APIPORT=3001
20+
RDS_HOSTNAME=neotomaprivate.cxkwxkjpj8zi.us-east-2.rds.amazonaws.com
21+
RDS_USERNAME=neotomaAdmin
22+
RDS_DATABASE=neotomatank
23+
RDS_PASSWORD=ndbgeopoliticalunits
24+
RDS_PORT=5432
25+
LOCALLIMIT=false
26+
SSL_CERT=true
27+
NATIVELANDKEY=1lMifvl80k2C6uQFEdEru
28+
PORT=3001
29+
HOSTED_ZONE_ID="Z06678132YXCZ3LP39MIP"
30+
DOMAIN_NAME="api.neotomadb.org"
31+
32+
docker build -f Dockerfile -t neoapi-prod:latest .
33+
aws ecr get-login-password --region ${AWS_REGION} | \
34+
docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com
35+
36+
# Tag image for ECR
37+
docker tag ${REPOSITORY_NAME}:${IMAGE_TAG} \
38+
${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${REPOSITORY_NAME}:${IMAGE_TAG}
39+
40+
# Push to ECR
41+
echo "Pushing image to ECR..."
42+
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${REPOSITORY_NAME}:${IMAGE_TAG}
43+
44+
echo "Ensuring App Runner service-linked role exists"
45+
aws iam create-service-linked-role --aws-service-name apprunner.amazonaws.com 2>/dev/null || echo "Service-linked role already exists"
46+
47+
aws cloudformation deploy \
48+
--template-file infrastructure/cloudformation-template.yaml \
49+
--stack-name ${STACK_NAME} \
50+
--parameter-overrides \
51+
Environment=${ENVIRONMENT} \
52+
ImageUri=${IMAGE_URI} \
53+
RDSHostname=${RDS_HOSTNAME} \
54+
RDSDatabase=${RDS_DATABASE} \
55+
RDSUsername=${RDS_USERNAME} \
56+
RDSPassword=${RDS_PASSWORD} \
57+
VPCId=${VPC_ID} \
58+
PrivateSubnets=${PRIVATE_SUBNETS} \
59+
Port=3001 \
60+
HostedZoneId=${HOSTED_ZONE_ID} \
61+
DomainName=${DOMAIN_NAME} \
62+
--capabilities CAPABILITY_NAMED_IAM \
63+
--region ${AWS_REGION}

openapi.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,11 +1065,9 @@ components:
10651065
preparedby:
10661066
properties:
10671067
contactid:
1068-
example: 44
1069-
type: integer
1068+
$ref: '#/components/schemas/contactid'
10701069
contactname:
1071-
example: 'Grimm, Eric Christopher'
1072-
type: string
1070+
$ref: '#/components/schemas/contactname'
10731071
familyname:
10741072
example: Grimm
10751073
type: string
@@ -1367,7 +1365,7 @@ components:
13671365
altitude:
13681366
type: integer
13691367
collectionunit:
1370-
type: string
1368+
$ref: '#/components/schemas/collectionunit'
13711369
collectionunitid:
13721370
$ref: '#/components/schemas/collectionunitid'
13731371
geography:

openapi/components/schemas/schemas.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,9 @@ chronology:
295295
preparedby:
296296
properties:
297297
contactid:
298-
example: 44
299-
type: integer
298+
$ref: '#/components/schemas/contactid'
300299
contactname:
301-
example: Grimm, Eric Christopher
302-
type: string
300+
$ref: '#/components/schemas/contactname'
303301
familyname:
304302
example: Grimm
305303
type: string
@@ -597,7 +595,7 @@ dataset:
597595
altitude:
598596
type: integer
599597
collectionunit:
600-
type: string
598+
$ref: '#/components/schemas/collectionunit'
601599
collectionunitid:
602600
$ref: '#/components/schemas/collectionunitid'
603601
geography:

public/tests.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)