Skip to content

file-compile

Shortcut: fc

Help option

~ $ dk file-compile --help


Current context is: default
Usage: dk file-compile [OPTIONS]

  Apply variables to a file based on a provided Variation.

Options:
  -v, --variation TEXT  variation name  [required]
  -f, --file TEXT       file path  [required]
  --help                Show this message and exit.

Compile a file using shortcuts

~/Kitchens/Feature_Sprint/Recipe1 $ dk fc -v Variation1 -f resources/s3-to-redshift.sql


Current context is: default
YYYY-MM-DD HH:MM:SS - Get the Compiled File of Recipe Recipe1.Variation1 in Kitchen Feature_Sprint
DKCloudCommand.get_compiled_file succeeded:
SET search_path TO hwproduction;

DROP TABLE if exists DEMO_SUPERSTORE_CUSTOMER_SEGMENT CASCADE;
CREATE TABLE DEMO_SUPERSTORE_CUSTOMER_SEGMENT
(
  Customer_ID      VARCHAR(100),
  Sales            NUMERIC(14,3),
  Profit           NUMERIC(14,3),
  Segment          VARCHAR(50)
);


copy DEMO_SUPERSTORE_CUSTOMER_SEGMENT
from 's3://dk-hello-world/superstore/customer/segment'
credentials 'aws_iam_role=arn:aws:iam::${vault://aws/account_id}:role/DKRedshift-for-HelloWorld'
ignoreheader 1
TRIMBLANKS delimiter '|';

select count(*) from DEMO_SUPERSTORE_CUSTOMER_SEGMENT;