Skip to content

Commit

Permalink
DBT:n ajokontin build
Browse files Browse the repository at this point in the history
  • Loading branch information
augustk committed Oct 2, 2024
1 parent aa9c8ba commit d2adc51
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-dbt-runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build DBT Runner Container

on:
workflow_dispatch:
push:
paths:
- 'dbt/**'
- 'dbt-container/**'

jobs:
build-and-deploy-container:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build container
run: dbt-container/build.sh


12 changes: 12 additions & 0 deletions dbt-container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM alpine:3.20
RUN apk upgrade --no-cache
RUN apk --no-cache add bash

WORKDIR /root/
COPY ./run.sh ./
COPY ./install.sh ./
RUN \
bash install.sh && \
rm install.sh

ENTRYPOINT ["bash", "/root/run.sh"]
4 changes: 4 additions & 0 deletions dbt-container/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Kontin käynnistäminen
```
docker run --rm --name dbt-runner ovara-dbt-runner
```
4 changes: 4 additions & 0 deletions dbt-container/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd "${0%/*}"
docker build --progress=plain -t ovara-dbt-runner .
cd -
19 changes: 19 additions & 0 deletions dbt-container/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -eu

case "$(uname -m)" in
aarch64) ARCHITECTURE="arm64" ;;
x86_64) ARCHITECTURE="amd64" ;;
*) ARCHITECTURE=$(uname -m) ;;
esac
echo $ARCHITECTURE

echo "Installing needed software"
apk --no-cache add \
python3

ln -sf /usr/bin/python3 /usr/bin/python

ls -Al /root
cat /root/run.sh
7 changes: 7 additions & 0 deletions dbt-container/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

echo "Running Ovara DBT script..."

exit 0

0 comments on commit d2adc51

Please sign in to comment.