Skip to content

Commit

Permalink
Merge pull request #12 from fishtown-analytics/fix/dockerfile
Browse files Browse the repository at this point in the history
Use dockerfile from dbt repo
  • Loading branch information
Kyle Wigley authored Jan 25, 2021
2 parents 03f70b0 + cc97d73 commit ef47267
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203, W503
27 changes: 0 additions & 27 deletions Dockerfile

This file was deleted.

18 changes: 13 additions & 5 deletions scripts/release-pypath/builder/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ def __init__(self):
def dbt_dir(self) -> Path:
return self.build_dir / "dbt"

@property
def docker_dir(self):
return self.dbt_dir / "docker"

@property
def dockerfile_path(self):
return self.docker_dir / "Dockerfile"

@property
def integration_test_dir(self) -> Path:
return self.dbt_dir / "test/integration"

@property
def dist_dir(self) -> Path:
return self.artifacts_dir / "dist"
Expand All @@ -81,10 +93,6 @@ def homebrew_template_pickle(self) -> Path:
def wheel_file(self) -> Path:
return self.artifacts_dir / "wheel_requirements.txt"

@property
def integration_test_dir(self) -> Path:
return self.dbt_dir / "test/integration"

@property
def linux_requirements_venv(self):
return self.build_dir / "linux_requirements_venv"
Expand All @@ -110,7 +118,7 @@ def homebrew_checkout_path(self) -> Path:
return self.build_dir / "homebrew-dbt"

def get_dbt_requirements_file(self, version: str) -> Path:
return self.dbt_dir / f"docker/requirements/requirements.{version}.txt"
return self.docker_dir / f"requirements/requirements.{version}.txt"


@dataclass
Expand Down
16 changes: 14 additions & 2 deletions scripts/release-pypath/builder/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@
def build_docker(args=None):
env = EnvironmentInformation()
release = ReleaseFile.from_artifacts(env)

requirements_path = env.get_dbt_requirements_file(str(release.version))
wheel_requirements_path = env.wheel_file
dist_dir_path = env.dist_dir
dockerfile_path = env.dockerfile_path
if requirements_path == requirements_path.absolute():
requirements_path = requirements_path.relative_to(Path.cwd())
if wheel_requirements_path == wheel_requirements_path.absolute():
wheel_requirements_path = wheel_requirements_path.relative_to(Path.cwd())
if dist_dir_path == dist_dir_path.absolute():
dist_dir_path = dist_dir_path.relative_to(Path.cwd())
if dockerfile_path == dockerfile_path.absolute():
dockerfile_path = dockerfile_path.relative_to(Path.cwd())

remote_tag = f"fishtownanalytics/dbt:{release.version}"

Expand All @@ -19,11 +29,13 @@ def build_docker(args=None):
"--build-arg",
f"BASE_REQUIREMENTS_SRC_PATH={requirements_path}",
"--build-arg",
"DIST_PATH=./artifacts/dist/",
f"DIST_PATH={dist_dir_path}",
"--build-arg",
"WHEEL_REQUIREMENTS_SRC_PATH=./artifacts/wheel_requirements.txt",
f"WHEEL_REQUIREMENTS_SRC_PATH={wheel_requirements_path}",
"--tag",
remote_tag,
"--file",
dockerfile_path,
".",
]

Expand Down

0 comments on commit ef47267

Please sign in to comment.