Skip to content

Commit bb8009e

Browse files
committed
added devcontainer and updated development files
1 parent f3ded8b commit bb8009e

File tree

9 files changed

+44
-3
lines changed

9 files changed

+44
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Python 3",
3+
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-bookworm",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
6+
},
7+
"postStartCommand": "bash .devcontainer/setup_odbc.sh && bash .devcontainer/install_pyenv.sh && bash .devcontainer/setup_env.sh",
8+
"runArgs": [
9+
"--env-file", "${localWorkspaceFolder}/.devcontainer/test.env"
10+
]
11+
}

.devcontainer/install_pyenv.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#/bin/bash
2+
curl https://pyenv.run | bash
3+
4+
echo 'export PYENV_ROOT="$HOME/.pyenv"
5+
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
6+
eval "$(pyenv init -)"' >> ~/.bashrc

.devcontainer/setup_env.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pyenv install 3.10.7
2+
pyenv virtualenv 3.10.7 dbt-sqlserver
3+
pyenv activate dbt-sqlserver
4+
5+
make dev
6+
make server

.devcontainer/setup_odbc.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
2+
3+
#Download appropriate package for the OS version
4+
#Choose only ONE of the following, corresponding to your OS version
5+
6+
#Debian 12
7+
curl https://packages.microsoft.com/config/debian/12/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
8+
9+
sudo apt-get update
10+
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
11+
# optional: for bcp and sqlcmd
12+
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
13+
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
14+
source ~/.bashrc
15+
# optional: for unixODBC development headers
16+
sudo apt-get install -y unixodbc-dev
17+
# optional: kerberos library for debian-slim distributions
18+
sudo apt-get install -y libgssapi-krb5-2

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: python3.9
2+
python: python3.10
33
repos:
44
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
55
rev: v4.4.0

dbt/include/sqlserver/macros/.gitkeep

Whitespace-only changes.

dbt/include/sqlserver/macros/adapters/.gitkeep

Whitespace-only changes.

dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ twine==4.0.2
33
wheel==0.42
44
pre-commit==3.5.0
55
pytest-dotenv==0.5.2
6-
dbt-tests-adapter~=1.7.3
6+
dbt-tests-adapter==1.7.2
77
flaky==3.7.0
88
pytest-xdist==3.5.0
99
-e .

devops/server.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ARG MSSQL_VERSION="2022"
22
FROM mcr.microsoft.com/mssql/server:${MSSQL_VERSION}-latest
33

44
ENV COLLATION="SQL_Latin1_General_CP1_CI_AS"
5-
5+
USER root
66
RUN mkdir -p /opt/init_scripts
77
WORKDIR /opt/init_scripts
88
COPY scripts/* /opt/init_scripts/

0 commit comments

Comments
 (0)