diff --git a/.travis.yml b/.travis.yml index 7646c11..27230c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: bionic language: python python: "3.10" @@ -29,5 +30,23 @@ script: after_script: - docker-compose exec $CONTAINER coverage report --omit=*/migrations/* -m +before_deploy: + - pip install awscli + - docker build -t ${APPLICATION_NAME} --target build . + - if [ ! -d deploy_scripts ]; then git clone https://github.com/RockefellerArchiveCenter/deploy_scripts.git; fi +deploy: + - provider: script + script: >- + bash deploy_scripts/containers/push_image_to_ecr.sh $APPLICATION_NAME && + bash deploy_scripts/upload_file_to_s3.sh ${APPLICATION_NAME}_template.yaml rac-dev-cloudformation-apps + on: + branch: development + - provider: script + script: >- + bash deploy_scripts/containers/add_tag_to_image.sh $APPLICATION_NAME dev prod && + bash deploy_scripts/upload_file_to_s3.sh ${APPLICATION_NAME}_template.yaml rac-prod-cloudformation-apps + on: + branch: base + notifications: email: false diff --git a/Dockerfile b/Dockerfile index 4ab8658..547a15e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,5 @@ COPY requirements.txt . RUN pip install -r requirements.txt ADD . /code/ -FROM base as test -COPY test_requirements.txt .coveragerc ./ -RUN pip install -r test_requirements.txt - FROM base as build EXPOSE 8080 \ No newline at end of file diff --git a/digitized_av_qc/config.py.example b/digitized_av_qc/config.py.example index 1a2885e..65fda8f 100644 --- a/digitized_av_qc/config.py.example +++ b/digitized_av_qc/config.py.example @@ -17,6 +17,6 @@ AQUILA_BASEURL = 'https://aquila.dev.rockarch.org' # BaseURL for Aquila instance AWS_ACCESS_KEY_ID = 'foo' # Access Key ID for AWS user (string) AWS_SECRET_ACCESS_KEY = 'bar' # Secret Access Key for AWS user (string) -AWS_ROLE_ARN = 'digitized-av-role' # Role ARN for role to be assumed by AWS user (string) +AWS_ROLE_ARN = 'arn:aws:iam::123456789012:role/digitized-av-role' # Role ARN for role to be assumed by AWS user (string) AWS_REGION = 'us-east-1' # AWS region in which infrastructure is located (string) AWS_SNS_TOPIC = 'digitized_av_notifications' # ARN for SNS Topic to be posted to (string) \ No newline at end of file diff --git a/digitized_av_qc_template.yaml b/digitized_av_qc_template.yaml new file mode 100644 index 0000000..e69de29 diff --git a/package_review/tests.py b/package_review/tests.py index 79004d3..ff267df 100644 --- a/package_review/tests.py +++ b/package_review/tests.py @@ -80,7 +80,6 @@ def setUp(self): @mock_sqs @mock_sts def test_deliver_message(self): - # TODO sns = boto3.client('sns', region_name='us-east-1') topic_arn = sns.create_topic(Name='my-topic')['TopicArn'] sqs_conn = boto3.resource("sqs", region_name="us-east-1")