This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
lambda-boilerplate/script/push
Marc Cataford 494bb4d681
refactor: pure bash instead of python scripts (#9)
docs: instructions around tooling

infra: fix linting and CI
2022-09-23 01:11:41 -04:00

20 lines
598 B
Bash

#!/usr/bin/bash
# Pushes the lambda archive to S3.
#
# This is a pre-condition to script/apply since creating
# the Lambda function will expect the source code to be
# available in the artifacts bucket.
#
# The project name is expected to be passed as an environment variable,
# i.e. ARCHIVE=<path-to-archive> . script/push
(
source $(dirname $0)/../.config
BOOTSTRAP_PROJECT=$(realpath $BOOTSTRAP_ROOT/infrastructure/bootstrap)
cd $BOOTSTRAP_PROJECT
BUCKET_NAME=$(terraform output --json | jq .artifacts_bucket_name.value -r)
cd -
aws s3 cp $ARCHIVE s3://$BUCKET_NAME
)