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 <