From 20b01d442c5964e70e555f8d75ed455fb5187ce5 Mon Sep 17 00:00:00 2001 From: Michael McGuinness Date: Wed, 9 Oct 2024 14:03:16 +0000 Subject: [PATCH] Merged in feature/dryRuns (pull request #232) Add dry runs * adddryruns * status Approved-by: Umang Mistry --- bitbucket-pipelines.yml | 44 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index fd0dc03..7999575 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -45,6 +45,22 @@ definitions: - python terraform.py plan --environment=$ENVIRONMENT --module=streamlit-server caches: - pip + - step: + name: Plan Snowflake Changes + image: python:3.7 + size: 2x + script: + - pip install snowflake-connector-python + - pip install schemachange --upgrade + - | + schemachange -a $SNOWFLAKE_ACCOUNT -u $SNOWFLAKE_USER \ + -f snowflake/ \ + -r $SNOWFLAKE_ROLE -w $SNOWFLAKE_WAREHOUSE \ + -d $SNOWFLAKE_DATABASE -c $SNOWFLAKE_DATABASE.SCHEMACHANGE.CHANGE_HISTORY \ + --create-change-history-table -v \ + --dry-run + caches: + - pip - step: image: hugree/terraform-with-snowsql:latest name: Plan Snowsql @@ -55,6 +71,23 @@ definitions: - python terraform.py plan --environment=$ENVIRONMENT --module=textract-pipeline/terraform --apply-extra-args="-target=null_resource.snowsql_client_create" caches: - pip + - step: + image: python:3.8 + name: Plan streamlit to EC2 + oidc: true + script: + - *aws-context + - apt-get install -y git + - >- + aws ssm send-command --document-name "AWS-RunShellScript" --instance-ids $INSTANCE_ID_TF --region $AWS_DEFAULT_REGION --parameters commands='[ + "sudo -u ubuntu -i <