Skip to content

Commit

Permalink
try a different approach, typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jul 17, 2023
1 parent 6566b9c commit ca1a85b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 36 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/dagger-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: docker/setup-buildx-action@v2

- uses: docker/build-push-action@v4
if: github.event_name == 'workflow_dispatch'
with:
context: .
file: "Dockerfile"
build-args: |
BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }}
tags: localpavics-sdi:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false

- uses: docker/build-push-action@v4
if: github.event_name != 'workflow_dispatch'
with:
context: .
file: "Dockerfile"
tags: localpavics-sdi:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false

- name: Dagger testing
run: |
export BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }}
pip install .[dagger]
python ./ci/dagger-pipeline.py
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ LABEL Description="PAVICS-SDI-TESTING-IMAGE" Vendor="Birdhouse" Version="1.3.0"
USER root

# Install build tools
RUN apt-get install --yes build-essential
RUN apt-get install --yes build-essential \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Switch to /code directory
WORKDIR /code
Expand Down
18 changes: 10 additions & 8 deletions ci/dagger-pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ async def main():
async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
top_level_dir = client.host().directory(Path(__file__).parent.parent.as_posix())

if os.getenv("CI"):
sources = (
client.container()
# pull container
.from_("localpavics-sdi:latest").with_workdir("/code")
)
else:
sources = await top_level_dir.docker_build()
# if os.getenv("CI"):
# sources = (
# client.container()
# # pull container
# .from_("localpavics-sdi:latest").with_workdir("/code")
# )
# else:
sources = await top_level_dir.docker_build(
build_args=os.getenv("BASE_IMAGE_TAG")
)

username = sources.with_exec(["whoami"])
whats_here = sources.with_exec(["ls", "-la", "/code"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
]
maintainers = [
{name = "Tuan Long Vu", email = "vu.long@ouranos.ca"},
{name = "David Huard", email = "huard.davis@ouranos.ca"},
{name = "David Huard", email = "huard.david@ouranos.ca"},
{name = "Trevor James Smith", email = "smith.trevorj@ouranos.ca"},
{name = "Francis Charette-Migneault", email = "francis.charette.migneault@gmail.com"}
]
Expand Down

0 comments on commit ca1a85b

Please sign in to comment.