Skip to content

CI Docker Integration Tests #60

CI Docker Integration Tests

CI Docker Integration Tests #60

name: CI Docker Integration Tests
on:
workflow_dispatch:
inputs:
target_branch:
description: "The branch to test from"
type: string
required: true
workflow_run:
workflows: ["CD Release"]
types:
- completed
jobs:
trigger:
if: github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Docker Integration Tests
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
ref: ${{ inputs.target_branch }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Docker
shell: bash
run: |
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo docker run hello-world
- name: Building Docker Image from Dockerfile
shell: bash
run: |
cd docker
docker build --tag docker_dbt .
docker images
- name: Clone JaffleShop DBT Project
shell: bash
run: |
git clone https://github.com/Teradata/jaffle_shop-dev.git jaffle_shop
- name: Running jaffle_shop dbt project from DBT Docker image
shell: bash
run: |
mkdir ~/.dbt
cat << EOF > profiles.yml
jaffle_shop:
outputs:
dev:
type: teradata
host: $DBT_TERADATA_SERVER_NAME
user: $DBT_TERADATA_USERNAME
password: $DBT_TERADATA_PASSWORD
logmech: TD2
schema: jaffle_shop
tmode: ANSI
threads: 1
timeout_seconds: 300
priority: interactive
retries: 1
target: dev
EOF
docker run --mount type=bind,source=$PWD/jaffle_shop,target=/usr/app --mount type=bind,source=$PWD/profiles.yml,target=/root/.dbt/profiles.yml docker_dbt:latest ls
docker run --mount type=bind,source=$PWD/jaffle_shop,target=/usr/app --mount type=bind,source=$PWD/profiles.yml,target=/root/.dbt/profiles.yml docker_dbt:latest debug
docker run --mount type=bind,source=$PWD/jaffle_shop,target=/usr/app --mount type=bind,source=$PWD/profiles.yml,target=/root/.dbt/profiles.yml docker_dbt:latest seed
docker run --mount type=bind,source=$PWD/jaffle_shop,target=/usr/app --mount type=bind,source=$PWD/profiles.yml,target=/root/.dbt/profiles.yml docker_dbt:latest run
docker run --mount type=bind,source=$PWD/jaffle_shop,target=/usr/app --mount type=bind,source=$PWD/profiles.yml,target=/root/.dbt/profiles.yml docker_dbt:latest test
env:
DBT_TERADATA_SERVER_NAME: ${{ vars.DBT_TERADATA_SERVER_NAME }}
DBT_TERADATA_USERNAME: ${{ vars.DBT_TERADATA_USERNAME }}
DBT_TERADATA_PASSWORD: ${{ vars.DBT_TERADATA_PASSWORD }}